Software:PDF.js

From HandWiki
Revision as of 07:15, 9 February 2024 by MedAI (talk | contribs) (add)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: PDF viewer in JavaScript included in Mozilla Firefox


PDF.js
Pdf-js logo.svg
PDF js Screenshot in Firefox 100.png
PDF.js in Firefox 100, with a table of contents displayed on the sidebar
Original author(s)Andreas Gal
Developer(s)Mozilla
Initial release2 July 2011 (2011-07-02)[1]
Written inJavaScript, CSS, HTML
PlatformJavaScript engine, web browser
Size3.94 MB[1]
TypePDF viewer
LicenseApache License 2.0[2]
Websitemozilla.github.io/pdf.js/

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 was originally created as an extension for Firefox[3] and is included in Firefox since 2012. (version 15),[4][5] and enabled by default since 2013 (version 19).[6][7]

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.[8] Its implementation uses the Canvas element from HTML5, which allows for fast rendering speeds.[8]

PDF.js is used in Thunderbird,[9] ownCloud,[10] Nextcloud,[11][12] and as browser extensions for Google Chrome/Chromium,[13] Firefox for Android,[14] Pale Moon[15][16] and SeaMonkey.[16][17]

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 Learning[20] 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 XFA[22]), 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 Profiles[24]
  • Spot colors
  • Overprint simulation[25]
  • 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

References

  1. 1.0 1.1 "Releases · mozilla/pdf.js". https://github.com/mozilla/pdf.js/releases. 
  2. "pdf.js/LICENSE at master · mozilla/pdf.js". 17 February 2022. https://github.com/mozilla/pdf.js/blob/master/LICENSE. 
  3. "PDF Viewer(discontinued)". https://addons.mozilla.org/en-US/firefox/addon/pdfjs/. 
  4. Parfeni, Lucian (2012-04-30). "PDF.JS and Download Manager Panel Pushed to Firefox 15". SoftNews. https://news.softpedia.com/news/PDF-JS-and-Download-Manager-Panel-Pushed-to-Firefox-15-267154.shtml. 
  5. Blagoveschenskiy, Anton (2012-08-29). "Вышла новая версия браузера Firefox 15" (in ru). https://www.rg.ru/2012/08/29/firefox-site-anons.html. 
  6. "Bug 773397 – Disable pdf.js prior to FF15 beta 5". https://bugzilla.mozilla.org/show_bug.cgi?id=773397. 
  7. "Firefox 19.0 Release Notes". https://www.mozilla.org/en-US/firefox/19.0/releasenotes/. 
  8. 8.0 8.1 Shankland, Stephen (2011-06-24). "Mozilla eyes hassle-free PDFs on the Web" (in en). https://www.cnet.com/culture/mozilla-eyes-hassle-free-pdfs-on-the-web/. 
  9. "810815 - Integrate pdf.js to Thunderbird" (in en). https://bugzilla.mozilla.org/show_bug.cgi?id=810815. 
  10. owncloud/files_pdfviewer, ownCloud, 2020-02-08, https://github.com/owncloud/files_pdfviewer, retrieved 2020-03-28 
  11. nextcloud/files_pdfviewer, Nextcloud, 2020-03-18, https://github.com/nextcloud/files_pdfviewer, retrieved 2020-03-28 
  12. "PDF viewer - Apps - App Store - Nextcloud". https://apps.nextcloud.com/apps/files_pdfviewer. 
  13. "PDF Viewer". https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm. 
  14. "Android PDF.js". https://addons.mozilla.org/android/addon/android-pdf-js. 
  15. "Add-ons - Moon PDF Viewer". https://addons.palemoon.org/addon/moon-pdf-viewer. 
  16. 16.0 16.1 "IsaacSchemm/pdf.js-seamonkey: SeaMonkey fork of pdf.js". https://github.com/IsaacSchemm/pdf.js-seamonkey. 
  17. "PDF Viewer for SeaMonkey". 25 April 2020. https://addons.thunderbird.net/seamonkey/addon/pdf-js-for-seamonkey. 
  18. Lauraharrisneal. "Annotations on Document Previews" (in en). https://dropbox.tech/application/annotations-on-document-previews. 
  19. "What matters to you, matters to us. - Slack Engineering" (in en-US). Slack Engineering. 2016-11-16. https://slack.engineering/what-matters-to-you-matters-to-us-10ff49650a5d. 
  20. "Under the hood: Learning with documents" (in en). 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"] (in en). https://bugzilla.mozilla.org/show_bug.cgi?id=1706133. 
  23. "Guide to Evaluating PDF.js Rendering". https://pdftron.com/blog/pdf-js/guide-to-pdf-js-rendering/. 
  24. "ICC profiles support for images · Issue #2856 · mozilla/pdf.js" (in en). https://github.com/mozilla/pdf.js/issues/2856. 
  25. "Overprint Support · Issue #7360 · mozilla/pdf.js" (in en). https://github.com/mozilla/pdf.js/issues/7360. 
  26. "Issue about knockout groups. · Issue #3136 · mozilla/pdf.js" (in en). https://github.com/mozilla/pdf.js/issues/3136. 
  27. "Frequently Asked Questions · mozilla/pdf.js Wiki" (in en). https://github.com/mozilla/pdf.js. 

External links