blob: 7a215babb36a82c8e8abd5a06a7f7177f41ac3ff [file] [edit]
This directory contains an official PDF.js release version, distributed at: https://github.com/mozilla/pdf.js
To update to a newer version:
1. Delete existing files except for this README.webkit.
2. Grab a new official release (pdfjs-*-dist.zip, non-legacy version) distributed at GitHub.
3. Extract everything into this directory.
4. Delete the binary .wasm files (currently jbig2.wasm, qcms_bg.wasm, openjpeg.wasm, and quickjs-eval.wasm).
5. Delete the .mjs.map files (currently pdf.mjs.map, viewer.mjs.map, pdf.worker.mjs.map, and pdf.sandbox.mjs.map).
6. Delete the example PDF file, compressed.tracemonkey-pldi-09.pdf.
7. From top source dir, run: 'Tools/glib/generate-pdfjs-resource-manifest.py --cmake --input=Source/ThirdParty/pdfjs --output=Source/ThirdParty/pdfjs/PdfJSFiles.cmake'
8. Build WebKit, your favorite port will do
9. Sanity-check:
* Load https://www.irs.gov/pub/irs-pdf/i1040gi.pdf (a big PDF)
* Test downloading the PDF
* Test opening the print dialog
Because the build process for PDF.js depends on a large number of Node.js dependencies, we choose
to build from upstream's prebuilt "dist" releases rather than the original source code. This is not
ideal and possibly violates the packaging requirements of most major Linux distributions. However,
requiring a huge number of Node.js packages would surely result in most distributions disabling the
PDF support altogether. The .mjs files are not minified or obfuscated, so using them is pragmatic.
Certain js files actually *are* minified, e.g. quickjs-eval.js. This is even more likely to violate
distro policies, but at least they are text and can be viewed in a text editor. If you follow the
above instructions to delete the .wasm files, then there should hopefully be no binary code.