Migrating from Mozilla PDF.js
Mozilla’s PDF.js is an open source, client-side PDF renderer completely based on JavaScript and supported by Mozilla. It focuses on parsing and rendering PDF documents, and it is currently Firefox’s built-in PDF viewer.
PDF.js can deal with most basic PDF content, but it has problems with more complex documents, which you can read up on below:
Since PDF.js uses the browser’s <canvas>
for rendering, results will vary between browsers (e.g. there’s a bug where text can be invisible in Internet Explorer 11). Support for IE and legacy Edge browsers is slowly being dropped.
Internet Explorer 11 is no longer supported in our Web SDK as of version 2022.5. Edge 18 is no longer supported in our Web SDK as of version 2023.2.
PSPDFKit for Web vs. PDF.js
PSPDFKit for Web, on the other hand, is a hybrid renderer: It can render on the client or server, depending on device capability and power. This allows you to view a 500 MB+ file on your smartphone, even on a slow connection; make notes that are instantly synced to our Instant on-premises server; and continue to mark up the file either on your desktop browser or in a native iOS app such as PDF Viewer.
PSPDFKit for Web’s client side uses the same technology as our iOS and Android platforms, thereby delivering the same high-fidelity rendering and a consistent result regardless of the browser capabilities.
Overview
PDF.js consists of three parts: a low-level PDF renderer, a display layer with a high-level API, and an example viewer implementation. The low-level API can read values from PDF documents. Then the display layer API can be used to render pages into canvas elements. In addition to the PDF rendering, PDF.js also comes with an example viewer implementation that makes use of the high-level API. The official API describes the rendering API access, whereas the viewer can currently only be configured with a limited amount of URL parameters.
PSPDFKit for Web as a PDF.js Alternative
In contrast, PSPDFKit for Web implements a rich and flexible production-ready viewer. With features like the fully configurable ViewState
and extensive CSS customization, we make sure you can provide your users with the best PDF viewer experience. We allow our viewer to be easily embedded in your existing application without the need to handle direct PDF render instructions.