An easy PDF viewer component that makes it easier to embed PDF files into your Vue 3 applications.
How to use it:
1. Import the PDF viewer.
import {usePDF, VuePDF} from 'VuePDF'
export default { components: { VuePDF }, // ... }
2. Add a PDF to your app.
<template> <VuePDF :pdf="pdf" :page="1" /> </template>
export default { components: { VuePDF }, setup(){ const { pdf, pages, info } = usePDF("myPDF.pdf") console.log(`Document has ${pages} pages`) console.log(`Document info: ${info}`) return { pdf } } }
3. Available props to customize the PDF viewer.
pdf: { required: true }, page: { type: Number, default: 1 }, scale: { type: Number, default: 1 }, rotation: Number, "text-layer": Boolean, "annotation-layer": Boolean
Preview:
Changelog:
v1.3.3 (01/20/2023)
- FIX: usePDF info ref fixed
v1.2.3 (10/11/2022)
- Fix: layers display
Download Details:
Author: TaTo30
Live Demo: https://tato30.github.io/VuePDF/#/basic
Download Link: https://github.com/TaTo30/VuePDF/archive/refs/heads/master.zip
Official Website: https://github.com/TaTo30/VuePDF
Install & Download:
# Yarn
$ yarn add @tato30/vue-pdf
# NPM
$ npm i @tato30/vue-pdf