
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
@vue-pdf-viewer/viewer
Advanced tools
A vue-pdf-viewer component for Vue and Nuxt. Suitable for vue-pdf document.
As developers ourselves, we faced many issues such as browser incompatibility and customizability while trying to render a PDF document or working with PDF libraries. Having faced issues using PDF libraries, we want the solution to be flexible for Vue.js developers and teams. More importantly, the technical document must be easy to use!
For the full feature set, visit Vue PDF Viewer Features.
Here’s how to get started with Vue PDF Viewer in your Vue 3 or Nuxt 3 project:
Here are the basic system requirements to run the Vue PDF Viewer component:
Remark:
Chrome | Firefox | Edge | Safari | Safari iOS | Chrome Android |
---|---|---|---|---|---|
115+ | 115+ | 115+ | 16.5+ | 16.5+ | 126+ |
Use your preferred package manager to install the Vue PDF Viewer package:
bun add @vue-pdf-viewer/viewer
npm install @vue-pdf-viewer/viewer
yarn add @vue-pdf-viewer/viewer
pnpm install @vue-pdf-viewer/viewer
Vue PDF Viewer 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 Vue PDF Viewer library. You might encounter an error, such as:
UnknownErrorException: The API version "4.4.168" does not match the Worker version "4.0.269".
To avoid version mismatch, please add pnpm.overrides to your package.json to specify the exact version of pdfjs-dist:
"pnpm": {
"overrides": {
"pdfjs-dist": "4.4.168"
}
}
After that, you can install Vue PDF Viewer via pnpm command
pnpm add @vue-pdf-viewer/viewer
For more information on how to use different package managers, please visit our installation guide.
To initiate Vue PDF Viewer, you will first need to import VPdfViewer component.
There are two main ways to use Vue PDF Viewer in your project, namely:
<script setup>
import { VPdfViewer } from '@vue-pdf-viewer/viewer'
</script>
<template>
<div :style="{ width: '1028px', height: '700px' }">
<VPdfViewer
src="https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf"
/>
</div>
</template>
<script>
import { VPdfViewer } from '@vue-pdf-viewer/viewer'
export default {
components: { VPdfViewer },
data() {
return {
src: 'https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf'
}
}
}
</script>
<template>
<VPdfViewer :src="src" />
</template>
You may also check out our Starter Toolkit for examples to get you started.
Enhance functionality with built-in properties and instance APIs to match your app’s needs.
For detailed usage, refer to our Documentation.
Here are some sample projects to get started on Vue PDF Viewer quickly:
We are more than happy to help you. If you have any questions, run into any errors or face any problems, please feel free to create an issue in Issues or PM us directly in Twitter. Anything related to VPV is on the table!
Vue PDF Viewer is distributed under our proprietary license. Please refer to our License page file for more details.
If you would like to use Vue PDF Viewer commercially, please purchase a license from our website or reach out to us directly at david@vue-pdf-viewer.dev.
FAQs
A vue-pdf-viewer component for Vue and Nuxt. Suitable for vue-pdf document.
The npm package @vue-pdf-viewer/viewer receives a total of 2,694 weekly downloads. As such, @vue-pdf-viewer/viewer popularity was classified as popular.
We found that @vue-pdf-viewer/viewer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.