Skip to content

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 [email protected].

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:

ChromeFirefoxEdgeSafariSafair iOSChrome 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 and yarn.

shell
bun add @vue-pdf-viewer/viewer
shell
yarn add @vue-pdf-viewer/viewer
shell
npm install @vue-pdf-viewer/viewer

To install via pnpm

VPV uses APIs from pdf.js and pnpm command will attempt to update the version of pdfjs-dist that may be higher than the default version in the VPV library.

To avoid version mismatch, please add pnpm.overrides to your package.json to specify the exact version of pdfjs-dist:

json
"pnpm": {
  "overrides": {
    "pdfjs-dist": "4.4.168"
  }
}

After that, you can install VPV via pnpm command

shell
pnpm add @vue-pdf-viewer/viewer

Installation issues on Apple M1 and later chipsets

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:

bash
$ brew install pkg-config cairo pango