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 extract the prebuilt files into some directory of your project. You may specify the path to this directory with viewerPath
property (by default is '/pdfjs-3.4.120-dist').
Install
npm install --save pdfjs-viewer-element
or
yarn add pdfjs-viewer-element
Usage
Extract the PDF.js prebuilt. See demo example.
import 'pdfjs-viewer-element'
<pdfjs-viewer-element src="/compressed.tracemonkey-pldi-09.pdf"></pdfjs-viewer-element>
Properties
src
- path to pdf file.
viewerPath
- path to viewer prebuilt directory (by default is '/pdfjs-3.4.120-dist').
License
MIT