pdfjs-viewer-element
A web component for PDF.js viewer. See demo.
⚠️ pdfjs-viewer-element
uses PDF.js prebuilt, that includes the generic build of PDF.js and the viewer. To use the package you should to extract the prebuilt file into a public directory of your project.
Install
npm install --save pdfjs-viewer-element
or
yarn add pdfjs-viewer-element
Usage
Import to your project:
import 'pdfjs-viewer-element'
Extract the PDF.js prebuilt. See example.
Use the element inside your template:
<pdfjs-viewer-element
src="/pdfjs-2.15.349-dist/web/compressed.tracemonkey-pldi-09.pdf"
height="100vh">
</pdfjs-viewer-element>
License
MIT