{"schemaVersion":"1.0","record":{"label":"PDF.js","description":"Web-standards PDF parsing and rendering library with a reusable browser viewer.","aliases":["Mozilla PDF.js","pdfjs-dist"],"kind":"software","website":"https://mozilla.github.io/pdf.js/","overview":"PDF.js is Mozilla's web-standards-based platform for parsing and rendering PDF documents. It includes a display API and a viewer interface built on that API, allowing developers to choose between embedding document rendering and adapting an existing reading interface. The software is available under Apache-2.0, with separate licensing for its documentation.","license":"Apache-2.0 software; documentation CC BY-SA 2.5","lifecycle":"active","example":false,"features":[{"name":"Browser rendering API","status":"supported","detail":"Display layer renders PDFs and exposes document information; viewer UI is a separate layer.","useCase":"Embedding PDF viewing in web applications","platforms":["Modern browsers","Legacy browser bundle","Node.js with documented limits"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://mozilla.github.io/pdf.js/getting_started/","locator":"Core, display and viewer layers; bundled worker and server requirement","retrievedAt":"2026-10-07T12:34:12.405Z","kind":"vendor"}]},{"name":"Cross-origin loading","status":"limited","detail":"Requires an appropriate server delivery arrangement such as CORS; ordinary JavaScript origin rules apply.","useCase":"Embedding PDF viewing in web applications","platforms":["Modern browsers","Legacy browser bundle","Node.js with documented limits"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions","locator":"Origin policy, modern/legacy support, worker version matching and annotation subset","retrievedAt":"2026-10-07T12:34:12.405Z","kind":"vendor"}]},{"name":"Annotation creation","status":"limited","detail":"Supports adding a subset of PDF annotation types, not every possible annotation operation.","useCase":"Embedding PDF viewing in web applications","platforms":["Modern browsers","Legacy browser bundle","Node.js with documented limits"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions","locator":"Origin policy, modern/legacy support, worker version matching and annotation subset","retrievedAt":"2026-10-07T12:34:12.405Z","kind":"vendor"}]}],"alternatives":[],"slug":"pdf-js","draftAlternatives":[{"targetSlug":"mupdf","status":"limited","detail":"An alternative for browser PDF rendering through an application integration; not a replacement for every MuPDF command-line or conversion feature.","useCase":"Embedding PDF viewing in web applications","platforms":["Modern browsers","Legacy browser bundle","Node.js with documented limits"],"region":"Version, build and integration requirements apply","evidence":[{"url":"https://mozilla.github.io/pdf.js/","locator":"Parsing/rendering identity and software/documentation licenses","retrievedAt":"2026-10-07T12:34:12.405Z","kind":"vendor"},{"url":"https://mozilla.github.io/pdf.js/getting_started/","locator":"Core, display and viewer layers; bundled worker and server requirement","retrievedAt":"2026-10-07T12:34:12.405Z","kind":"vendor"},{"url":"https://mupdf.readthedocs.io/en/latest/guide/what-is-mupdf.html","locator":"JavaScript/WebAssembly interface and separate commercial WebViewer","retrievedAt":"2026-10-07T12:34:12.405Z","kind":"vendor"}]}],"evidence":[{"url":"https://mozilla.github.io/pdf.js/","locator":"Parsing/rendering identity and software/documentation licenses","retrievedAt":"2026-10-07T12:34:12.405Z","kind":"vendor"},{"url":"https://mozilla.github.io/pdf.js/getting_started/","locator":"Core, display and viewer layers; bundled worker and server requirement","retrievedAt":"2026-10-07T12:34:12.405Z","kind":"vendor"}],"document":{"version":1,"references":[{"url":"https://mozilla.github.io/pdf.js/","locator":"Parsing/rendering identity and software/documentation licenses","retrievedAt":"2026-10-07T12:34:12.405Z","id":"home","title":"PDF.js homepage","kind":"vendor"},{"url":"https://mozilla.github.io/pdf.js/getting_started/","locator":"Core, display and viewer layers; bundled worker and server requirement","retrievedAt":"2026-10-07T12:34:12.405Z","id":"layers","title":"PDF.js getting started","kind":"vendor"},{"url":"https://mozilla.github.io/pdf.js/examples/","locator":"Asynchronous document/page rendering, viewports and canvas serialization","retrievedAt":"2026-10-07T12:34:12.405Z","id":"examples","title":"PDF.js examples","kind":"vendor"},{"url":"https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions","locator":"Origin policy, modern/legacy support, worker version matching and annotation subset","retrievedAt":"2026-10-07T12:34:12.405Z","id":"faq","title":"PDF.js FAQ","kind":"vendor"},{"url":"https://mupdf.readthedocs.io/en/latest/guide/what-is-mupdf.html","locator":"JavaScript/WebAssembly interface and separate commercial WebViewer","retrievedAt":"2026-10-07T12:34:12.405Z","id":"mupdf","title":"MuPDF framework overview","kind":"vendor"}],"overviewCitations":["home","layers"],"licenseCitations":["home"],"sections":[{"id":"architecture","heading":"Integration layers","paragraphs":[{"id":"architecture-detail","content":[{"text":"The core parses and interprets binary PDF data, while the display layer exposes a more accessible API. The viewer adds the reading interface used by Firefox and related project extensions. Developers can therefore render pages in their own interface or adapt the supplied viewer. Direct use of the core is described as advanced, with an API more liable to change than the documented display-layer surface."}],"citations":["layers"]}]},{"id":"rendering","heading":"Asynchronous page rendering","paragraphs":[{"id":"rendering-detail","content":[{"text":"Document loading, page retrieval and rendering are asynchronous operations. The examples use a viewport to determine scale and rotation, then draw into a canvas with appropriate pixel dimensions. The tutorial also warns against simultaneous rendering of two pages into the same canvas. A document viewer must coordinate these operations with its navigation and error handling rather than assume every page is immediately available."}],"citations":["examples"]}]},{"id":"delivery","heading":"Document delivery and deployment","paragraphs":[{"id":"delivery-detail","content":[{"text":"Browser origin rules apply to PDF loading, so a remote document needs an appropriate delivery setup. The display library and worker must use exactly matching versions; mixed cached or CDN files can trigger a version error. The project offers modern and legacy bundles with different support expectations. Its local-viewer instructions use a server because the worker is not enabled for file URLs."}],"citations":["faq","layers"]}]},{"id":"scope","heading":"Review capabilities and interface scope","paragraphs":[{"id":"scope-detail","content":[{"text":"The FAQ describes viewing existing annotations and creating a subset of annotation types. That is a narrower promise than a complete PDF editing suite. The display API and the full viewer also represent different integration levels: drawing a page in a custom canvas does not automatically provide all of the packaged viewer's interaction features. Applications must identify which layer supplies their required user experience."}],"citations":["faq","layers","examples"]}]},{"id":"comparison","heading":"Substitution considerations","paragraphs":[{"id":"comparison-detail","content":[{"text":"PDF.js can substitute for "},{"text":"MuPDF","targetSlug":"mupdf"},{"text":" in the specific role of rendering PDFs inside a web application. MuPDF also offers a JavaScript interface and a separately licensed WebViewer product, so the comparison should specify the integration being replaced. PDF.js's Apache-licensed rendering stack is not evidence of equivalence with every packaged viewer or document-conversion command. Choose around the needed browser interface, supported documents and deployment requirements."}],"citations":["home","layers","mupdf"]}]}]},"id":"Q656","revision":704,"updatedAt":"2026-10-13T01:33:08Z","sourceUrl":"https://substitutefor.net/entities/Q656?revision=704"}}