Getting Started
INFO
To try Vue PDF Viewer library for free, simply follow the instruction in the docs. For commercial use, please purchase a license or reach out to us at david@vue-pdf-viewer.dev.
Prerequisites
Here are the basic system requirements to run the Vue PDF Viewer component:
- Vue version: >= 3.0
- Nuxt version: >= 3.0
Remark:
- Vite version will affect the Vue or Nuxt version used.
- If using TypeScript, it requires >= TypeScript 4.6.
Browser support
Vue PDF View component is supported only in modern browsers as follow:
Chrome | Firefox | Edge | Safari | Safair iOS | Chrome Android |
---|---|---|---|---|---|
115+ | 115+ | 115+ | 16.5+ | 16.5+ | 126+ |
Installation
Install Vue PDF Viewer
There are a few ways you can install Vue PDF Viewer, namely bun
, npm
, pnpm
or yarn
.
To install using bun
, run:
bun add @vue-pdf-viewer/viewer
Caching of previous Worker version with bun
To clear cache, try running bun pm cache rm
to remove cache in the global cache directory. If the error remains, try executing the following steps:
rm bun.lockb
rm -R node_modules
Please ensure that you follow this step if you want to override pdfjs-dist
version. After that, you may execute this command to install all dependencies again.
bun i
Installation issues
Apple M series
Since the default version of pdfjs-dist
in VPV requires the canvas
package, you may need to manually add the canvas
package for Apple M1 and later chipsets.
You may use Brew
, a popular package manager to install the canvas dependencies:
$ brew install pkg-config cairo pango