» npm install @vue-pdf-viewer/viewer
Videos
» npm install pdf-vue3
» npm install vue3-pdfjs
» npm install vue3-pdf-app
» npm install vue3-pdf
I found out the issue was scoped CSS. Since the element renders later, the scoped CSS wasn't getting applied. Below is the imported css that needs to be in an unscoped style tag.
@import '../../node_modules/pdfjs-dist/web/pdf_viewer.css';
- Install the pdfjs-dist library:
npm i pdfjs-dist
Locate the
pdf.worker.min.mjsfile in thenode_modules/pdfjs-dist/builddirectory and copy it to thepublicdirectory.Import it in your component:
import * as pdfjsLib from "pdfjs-dist";
import pdfWorker from "/pdf.worker.min.mjs?url";
pdfjsLib.GlobalWorkerOptions.workerSrc = pdfWorker;
Hello Vuejs community! I'm excited to share my open-source project, 'PDF-Frame-Vue', designed specifically for Vue applications. It's a framework that allows you to create interactive and visually rich PDFs and Canvas graphics with its intuitive HTML template syntax.
I would love to get your feedback and support on this. It's crafted to enhance the capabilities of Vue apps. Looking forward to hearing your thoughts and suggestions! Attaching a blog along with the examples for your reference.
Blog: ://nswamy14.hashnode.dev/creating-visually-rich-pdfs-with-pdf-frame-vue
Github Repo: https://github.com/I2Djs/pdf-frame
Pdf Example: https://stackblitz.com/edit/pdf-frame-vuejs
Canvas Example: https://stackblitz.com/edit/pdf-frame-vuejs-canvas-qp1rhy
Vue 3 component for PDF and Canvas graphics
» npm install vue-pdf-embed