Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
PDF.js
PDF viewer in JavaScript included in Mozilla Firefox

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.

Related Image Collections Add Image
We don't have any YouTube videos related to PDF.js yet.
We don't have any PDF documents related to PDF.js yet.
We don't have any Books related to PDF.js yet.
We don't have any archived web articles related to PDF.js yet.

History and application

PDF.js was originally created as an extension for Firefox1 and is included in Firefox since 2012 (version 15),23 and enabled by default since 2013 (version 19).45 It was added to Firefox for Android in 2023 (version 111).6

The project was created to provide a way for viewing PDF documents natively in the web browser, which prevents potential security risks when opening PDF documents outside a browser, as the code for displaying the document is sandboxed in a browser.7 Its implementation uses the Canvas element from HTML5, which allows for fast rendering speeds.8

PDF.js is also used in Thunderbird,9 ownCloud,10 Nextcloud,1112 and is available as a browser extension for Google Chrome/Chromium,13 Pale Moon1415 and SeaMonkey.1617

It can be integrated or embedded in a web or native application to enable PDF rendering and viewing, and allows advanced usages such as Server-side rendering.

Many web applications, including Dropbox,18 Slack,19 and LinkedIn Learning20 integrate PDF.js to enable previewing PDF documents.

Behavior

According to a benchmark by Mozilla, PDF.js is performant for viewing most common PDF files, while it may have some issues with large or 'graphics-heavy' documents.21

PDF.js supports most of the PDF specifications (including form support or XFA22), but some features have not been implemented yet, which may impact rendering behavior depending on the features the document uses.23

Several PDF/X or optional PDF features that are not supported in PDF.js include:

  • ICC Color Profiles24
  • Spot colors
  • Overprint simulation25
  • Transparency groups (knockout/isolation)26
  • High-fidelity printing

The PDF.js contributor community also notes that the browser behavior of PDF.js varies with browser support for PDF.js's required features.27 Performance and reliability will be the best on Chrome and Firefox, which are fully supported and subject to automated testing.

See also

  • Free and open-source software portal

References

  1. "PDF Viewer(discontinued)". addons.mozilla.org. Archived from the original on 5 December 2015. Retrieved 2 December 2015. https://web.archive.org/web/20151205121858/https://addons.mozilla.org/en-US/firefox/addon/pdfjs/

  2. Parfeni, Lucian (30 April 2012). "PDF.JS and Download Manager Panel Pushed to Firefox 15". Softpedia. SoftNews. https://news.softpedia.com/news/PDF-JS-and-Download-Manager-Panel-Pushed-to-Firefox-15-267154.shtml

  3. Blagoveschenskiy, Anton (29 August 2012). "Вышла новая версия браузера Firefox 15" [New version 15 of the Firefox browser released]. Rossiyskaya Gazeta (in Russian). Retrieved 9 September 2012. https://www.rg.ru/2012/08/29/firefox-site-anons.html

  4. "Bug 773397 – Disable pdf.js prior to FF15 beta 5". bugzilla.mozilla.org. https://bugzilla.mozilla.org/show_bug.cgi?id=773397

  5. "Firefox 19.0 Release Notes". mozilla.org. Retrieved 30 April 2013. https://www.mozilla.org/en-US/firefox/19.0/releasenotes/

  6. "Firefox for Android 111.0, See All New Features, Updates and Fixes". www.mozilla.org. Retrieved 19 April 2024. https://www.mozilla.org/en-US/firefox/android/111.0/releasenotes/

  7. Shankland, Stephen (24 June 2011). "Mozilla eyes hassle-free PDFs on the Web". CNET. Retrieved 24 May 2022. https://www.cnet.com/culture/mozilla-eyes-hassle-free-pdfs-on-the-web/

  8. Shankland, Stephen (24 June 2011). "Mozilla eyes hassle-free PDFs on the Web". CNET. Retrieved 24 May 2022. https://www.cnet.com/culture/mozilla-eyes-hassle-free-pdfs-on-the-web/

  9. "810815 - Integrate pdf.js to Thunderbird". bugzilla.mozilla.org. Retrieved 28 January 2022. https://bugzilla.mozilla.org/show_bug.cgi?id=810815

  10. owncloud/files_pdfviewer, ownCloud, 8 February 2020, retrieved 28 March 2020 https://github.com/owncloud/files_pdfviewer

  11. nextcloud/files_pdfviewer, Nextcloud, 18 March 2020, retrieved 28 March 2020 https://github.com/nextcloud/files_pdfviewer

  12. "PDF viewer - Apps - App Store - Nextcloud". apps.nextcloud.com. Retrieved 28 March 2020. https://apps.nextcloud.com/apps/files_pdfviewer

  13. "PDF Viewer". Chrome Web Store. https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm

  14. "Add-ons - Moon PDF Viewer". Pale Moon - Add-ons. Archived from the original on 3 January 2020. Retrieved 4 May 2021. https://web.archive.org/web/20200103222159/https://addons.palemoon.org/addon/moon-pdf-viewer/

  15. "IsaacSchemm/pdf.js-seamonkey: SeaMonkey fork of pdf.js". GitHub. Archived from the original on 6 December 2020. Retrieved 4 May 2021. https://github.com/IsaacSchemm/pdf.js-seamonkey

  16. "IsaacSchemm/pdf.js-seamonkey: SeaMonkey fork of pdf.js". GitHub. Archived from the original on 6 December 2020. Retrieved 4 May 2021. https://github.com/IsaacSchemm/pdf.js-seamonkey

  17. "PDF Viewer for SeaMonkey". Add-ons for SeaMonkey. 25 April 2020. https://addons.thunderbird.net/seamonkey/addon/pdf-js-for-seamonkey

  18. Lauraharrisneal. "Annotations on Document Previews". dropbox.tech. Retrieved 5 August 2021. https://dropbox.tech/application/annotations-on-document-previews

  19. "What matters to you, matters to us. - Slack Engineering". Slack Engineering. 16 November 2016. Retrieved 5 August 2021. https://slack.engineering/what-matters-to-you-matters-to-us-10ff49650a5d

  20. "Under the hood: Learning with documents". engineering.linkedin.com. Retrieved 5 August 2021. https://engineering.linkedin.com/blog/2019/04/under-the-hood--learning-with-documents

  21. "How fast is PDF.js? – Mozilla Hacks - the Web developer blog". https://hacks.mozilla.org/2014/05/how-fast-is-pdf-js/

  22. "1706133 - (pdf-xfa) [meta] XFA support". bugzilla.mozilla.org. Retrieved 28 January 2022. https://bugzilla.mozilla.org/show_bug.cgi?id=1706133

  23. "Guide to Evaluating PDF.js Rendering". PDFTron. Retrieved 5 August 2021. https://pdftron.com/blog/pdf-js/guide-to-pdf-js-rendering/

  24. "ICC profiles support for images · Issue #2856 · mozilla/pdf.js". GitHub. Retrieved 24 May 2022. https://github.com/mozilla/pdf.js/issues/2856

  25. "Overprint Support · Issue #7360 · mozilla/pdf.js". GitHub. Retrieved 24 May 2022. https://github.com/mozilla/pdf.js/issues/7360

  26. "Issue about knockout groups. · Issue #3136 · mozilla/pdf.js". GitHub. Retrieved 24 May 2022. https://github.com/mozilla/pdf.js/issues/3136

  27. "Frequently Asked Questions · mozilla/pdf.js Wiki". GitHub. Retrieved 5 August 2021. https://github.com/mozilla/pdf.js