Updated Setup PDF.js in a website (markdown)

Jonas Jenwald 2022-11-04 11:29:08 +01:00
parent ed8076801c
commit de8ce480f3

@ -25,15 +25,5 @@ To use the library in your project add `require('pdfjs-dist')` to your file requ
Refer to https://github.com/mozilla/pdf.js/tree/master/examples/webpack for a complete example.
#### Browserify
Install the PDF.js dependency in your project:
npm install pdfjs-dist --save-dev
To use the library in your project add `require('pdfjs-dist')` to your file requires and build your project normally. The worker shall be built into a separate bundle: take the file "./node_modules/pdfjs-dist/build/pdf.worker.entry.js" or built a separate file that uses `require('pdfjs-dist/build/pdf.worker')`. `PDFJS.workerSrc` shall be set to point to this file.
Refer to https://github.com/mozilla/pdf.js/tree/master/examples/browserify for a complete example.
## Build PDF.js from source
After cloning PDF.js, you can build PDF.js from source by running the `gulp generic` command. This will create the built PDF.js in the `build` folder.