pdfjs-forms-dist
v2.2.228
Published
Generic build of Mainegreen's forms fork of Mozilla's PDF.js library.
Downloads
30
Maintainers
Readme
PDF.js
PDF.js is a Portable Document Format (PDF) library that is built with HTML5. Our goal is to create a general-purpose, web standards-based platform for parsing and rendering PDFs.
This is a pre-built version of the PDF.js Forms source code.
To use in webpack first install:
npm install pdfjs-forms-dist
Then include in your files:
import pdfjsLib from 'pdfjs-forms-dist';
import * as pdfjsViewer from 'pdfjs-forms-dist/web/pdf_viewer';
import 'pdfjs-forms-dist/web/pdf_forms.css';
You may need to set your pdf worker bundle in your code depending on how you configure your webpack:
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
to
pdfjsLib.GlobalWorkerOptions.workerSrc = '../../build/webpack/pdf.worker.bundle.js';
You may need to add to your webpack config:
entry: {
'pdf.worker': 'pdfjs-forms-dist/build/pdf.worker.entry'
}
See https://github.com/mozilla/pdf.js or https://github.com/mainegreen/pdf.js for learning and contributing.