Also known as PDF Viewer
PDF.js is a JavaScript library that renders Portable Document Format (PDF) files using the web standards-compliant HTML5 Canvas. The project is led by the Mozilla Corporation after Andreas Gal launched it (initially as an experiment) in 2011.
via Wikipedia infobox
~2 min read
PDF.js is a JavaScript library that renders Portable Document Format (PDF) files using the web standards-compliant HTML5 Canvas. The project is led by the Mozilla Corporation after Andreas Gal launched it (initially as an experiment) in 2011.
== History and application ==
PDF.js is a Portable Document Format (PDF) viewer that is built with HTML5. PDF.js is community-driven and supported by Mozilla. Our goal is to create a general-purpose, web standards-based platform for parsing and rendering PDFs. PDF.js is an open source project and always looking for more contributors. To get involved, visit: Issue Reporting Guide Code Contribution Guide Frequently Asked Questions Good Beginner Bugs Projects Feel free to stop by our Matrix room for questions or guidance. Please note that the "Modern browsers" version assumes native support for the latest JavaScript features; please also see this wiki page. Modern browsers: Older browsers: Chrome The official extension for Chrome can be installed from the Chrome Web Store. This extension is maintained by @Rob--W. Build Your Own - Get the code as explained below and issue npx gulp chromium . Then open Chrome, go to Tools Extension and load the (unpackaged) extension from the directory build/chromium . Next, install Node.js via the official package or via nvm. If everything worked out, install all dependencies for PDF.js: Finally, you need to start a local web server as some browsers do not allow opening PDF files using a file:// URL. Run: and then you can open: Please keep in mind that this assumes the latest version of Mozilla Firefox; refer to Building PDF.js for non-development usage of the PDF.js library. This will generate pdf.js and pdf.worker.js in the build/generic/build/ directory (respectively build/generic-legacy/build/ ). Both scripts are needed but only pdf.js needs to be included since pdf.worker.js will be loaded by pdf.js . The PDF.js files are large and should be minified for production. When coverage is enabled, the build instruments the bundled code with babel-plugin-istanbul , which adds counters that record every line, branch and function that runs: For browser-based tests (unit, integration and reference tests) the instrumented code runs in the browser, fills a global window. coverage object, and the test runner collects it from each browser session, merges the results, and writes the report. For the Node-based unit tests ( unittestcli ) the raw data is written to build/tmp/unittestcli-coverage.json and turned into a report afterwards. --coverage Enable coverage collection. off --coverage-output Directory where the report is written. build/coverage --coverage-formats Comma-separated list of formats: info , html , json , text , cobertura , clover . info --coverage-per-test Also build a per-test index (see below). off unit tests.yml unittest unittest integration tests.yml integrationtest integrationtest coverage browser tests.yml botbrowsertest browsertest To use PDF.js in a web application you can choose to use a pre-built version of the library or to build it from source. We supply pre-built versions for usage with NPM under the pdfjs-dist name. For more information and examples please refer to the wiki page on this subject. More examples can be found in the examples folder. Some of them are using the pdfjs-dist package, which can be built and installed in this repo directory via npx gulp dist-install command. For an introduction to the PDF.js code, check out the presentation by our contributor Julian Viereck: More learning resources can be found at: The API documentation can be found at: Questions
Excerpt from the source-code README · 8,324 chars · not written by Vinony
via Wikidata · CC0
via Wikidata sitelinks · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).