pdfjs-forms-dist

2.2.228 • Public • Published

PDF.js npm

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.

Package Sidebar

Install

npm i pdfjs-forms-dist

Weekly Downloads

10

Version

2.2.228

License

Apache-2.0

Unpacked Size

15.9 MB

Total Files

535

Last publish

Collaborators

  • mainegreen