# PDF.js: 8.7 out of 10

A strong pick. 1st of 9 in [PDF libraries](https://elestia.ai/opensource/pdf/index.md).

PDF.js is Mozilla's PDF parser and renderer, the engine behind Firefox's built-in viewer. It is the default open-source choice for showing PDFs in a browser and for pulling text out of them. It cannot create new PDFs, so pair it with a generator such as pdf-lib, PDFKit or pdfmake when you need one.

**Best for:** Web apps that must display, search or extract text from PDFs with consistent rendering across browsers.

## Scores

- **Overall: 8.7** (likely 7.6 to 9.3)
  - Claude Opus 5.5 (8.5): It is the default open-source pick for rendering and reading PDFs in JavaScript. It is funded, very active and more widely used than any peer. It is not a 9+ for the whole category because it cannot create PDFs. Fiddly Node and bundler setup and recurring script-injection fixes mean you need to stay on current versions.
  - GPT-6.2 Sol (8.8): PDF.js is the first choice among these peers for a custom browser viewer because it combines a capable rendering engine, active maintenance, and established production use. React-PDF offers a simpler React interface, unpdf simplifies serverless extraction, and PDFKit is better suited to generating documents. Worker setup, performance on complex PDFs, and recurring security fixes keep the score below a universal recommendation for PDF work.
- **Needed by many: 5.3** (likely 4.1 to 6.4)
  - Claude Opus 5.5 (6.0): Many web apps need to show PDFs, and text extraction for search and AI pipelines has widened that need. Still, plenty of projects never touch PDFs. Within the category it covers reading and showing but not making files.
  - GPT-6.2 Sol (4.5): PDF viewing and extraction serve a clear niche across document portals, business apps, and ingestion pipelines. PDF.js works without a frontend framework and supports some Node.js use, while its API centers on existing documents. The available developer survey gives little basis for estimating how many teams need embedded PDF handling.
- **Helps a lot: 8.6** (likely 7.5 to 9.3)
  - Claude Opus 5.5 (8.5): Independent comparisons call it a highly reliable renderer with broad PDF support. It is the reference engine that many viewers and wrappers build on, and recent releases added signature verification, a renderer worker and annotation editing. Points come off because it cannot generate PDFs, bundler and Node setup is fiddly, and wrappers like unpdf exist to hide those rough edges.
  - GPT-6.2 Sol (8.7): Version 6.5.438 combines a mature viewer with a typed API for rendering, text extraction, and annotations. Official examples give coding agents a clear starting point, and an integrator reported that dependency hoisting can still load an incompatible worker. A competing renderer’s Node.js benchmark found slower first renders and higher memory use than PDFium, and a current user report documents clipped variable-font glyphs on macOS. Performance and fidelity depend on the files and runtime.
- **Holds up over time: 9.3** (likely 8.3 to 9.9)
  - Claude Opus 5.5 (9.5): Mozilla funds it and ships it in Firefox. It had 3,189 commits and 12 releases in the last year, and 543 people have contributed over its history. Issues are handled at scale, with 382 open against 10,316 closed. The only drag is frequent API-minor changes and a v6.0 major that removed older call forms.
  - GPT-6.2 Sol (9.0): Mozilla ships PDF.js in Firefox, several contributors maintain it, and the bundle records 12 releases and 3,189 commits in a year. Maintainers responded the same day to a recent font report, and downstream projects are adopting version 6. One maintainer is listed on the recent GitHub releases, and the number of people who can trigger npm publication is unclear. Version 6 also required changes to some direct API calls and raised browser requirements.
- **Used widely: 7.8** (likely 6.7 to 8.7)
  - Claude Opus 5.5 (9.0): It has 225M downloads in 4 weeks, up about 10.9x against a median of 4.1x, which is the category's highest. Many of those come through wrappers such as react-pdf, React-PDF viewer and unpdf, so direct choice is lower than raw installs suggest. Its 17.8k dependent repos and 54k stars, the most among peers, still show very wide direct use.
  - GPT-6.2 Sol (6.6): Four-week npm downloads rose from 20.7 million to 225.6 million, or 10.9× against the 4.1× catalog baseline. That leads the peer group in volume, while PDFKit, pdf-lib, and unpdf grew faster from smaller bases. The 17,822 tracked dependent repositories exceed the React-PDF viewer’s count and trail PDFKit, jsPDF, and pdfmake. Automated and transitive installs inflate npm counts, while CDN and bundled use leave the number of direct choices uncertain.
- **Vouched for: 8.9** (likely 7.9 to 9.6)
  - Claude Opus 5.5 (9.0): Firefox ships it to hundreds of millions of users. Many viewers and tools build on it, including React-PDF viewer, unpdf and Polotno's importer. Independent and vendor comparisons alike name it the standard for rendering, though no developer survey covers this category.
  - GPT-6.2 Sol (8.8): Firefox and Nextcloud ship PDF.js in their viewers, and React-PDF and unpdf continue to invest in it as their rendering engine. These deployments cover both browser viewing and server-side extraction. Survey evidence on developer satisfaction is thin, and the available benchmarks cover specific workloads.
- **Safe: 7.6** (likely 6.5 to 8.6)
  - Claude Opus 5.5 (7.5): It has no dependencies, an Apache-2.0 licence and a Scorecard of 8.3 with fuzzing and SAST. Releases are not signed. It parses untrusted files, and three high-severity script-injection advisories (2022, 2024, 2026) show this is a recurring risk. The 2026 bug was exploitable with default scripting on and was fixed in 6.2.108. Setting a strict CSP and keeping current lowers the risk.
  - GPT-6.2 Sol (7.6): The Apache-2.0 package has zero required npm dependencies, and Node.js rendering can use an optional native canvas package. All three listed high-severity advisories have fixed versions, and the latest fix shipped in 6.2.108 by public disclosure. The 8.3 Scorecard reflects strong review and fuzzing, with a zero for signed releases and an unverified branch-protection result. GitHub Actions handles npm publication, while recurring viewer vulnerabilities and limited visibility into publisher access keep the range wide.

## Good

- It is the most complete open-source PDF renderer in JavaScript, tested daily by shipping inside Firefox.
- Mozilla pays for active maintenance, with about 3,200 commits and monthly releases in the last year.
- It has no runtime dependencies, ships its own TypeScript types and uses the permissive Apache-2.0 licence.
- It includes a full viewer with text selection, forms, annotation editing and, since v6.2, signature verification.

## Bad

- It cannot generate PDFs, so it covers only the read-and-show half of the category.
- Worker setup, CMap and font paths, and the legacy build for Node and serverless are common sources of friction.
- Malicious PDFs have led to repeated high-severity script-injection bugs (2022, 2024, 2026), so users must keep it patched.
- Minor releases often change API return types, and v6.0 removed older call forms, so upgrades can need code changes.

## The numbers

- Downloads, 4 weeks: 226M
- In a year: ×11
- GitHub stars: 54k
- Commits, 12 months: 3.2k
- Last npm release: Nov 2026
- Advisories, 24 months: 1
- Licence: Apache-2.0
- GitHub: https://github.com/mozilla/pdf.js
- npm: https://www.npmjs.com/package/pdfjs-dist

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
