Elestia Open Source Ratings
8.7

PDF.js

A strong pick. 1st of 9 PDF libraries.

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.

WebsiteGitHubnpm

Scores

Overall8.7

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 8.5, likely 7.5 to 9.0

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, likely 7.6 to 9.6

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 many5.3

How many developers need a tool for this job?

Claude Opus 5.5: 6.0, likely 5.0 to 7.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, likely 3.2 to 5.8

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 lot8.6

How well does it do the job for those who need it?

Claude Opus 5.5: 8.5, likely 7.5 to 9.0

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, likely 7.5 to 9.5

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 time9.3

Will it still be a good choice in two years?

Claude Opus 5.5: 9.5, likely 8.5 to 10.0

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.

  • github commitsLastYear: 3,189 commits in the last year.
  • github releasesLastYear: 12 releases. Latest on 2026-11-01.
  • github openIssues/closedIssues: 382 open against 10,316 closed.
  • github.com/mozilla/pdf.js/releases: v6.0 api-major removals. Many api-minor return-type changes.

GPT-6.2 Sol: 9.0, likely 8.0 to 9.8

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 widely7.8

How many use it, and is that growing?

Claude Opus 5.5: 9.0, likely 8.0 to 9.5

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, likely 5.3 to 7.8

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.

  • npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo, medianDownloadsRatio: 225.6 million versus 20.7 million downloads, up 10.9× against a 4.1× baseline.
  • dependents, peers: 17,822 tracked repositories and 1,630 packages, with three peers ahead on repository count.
  • github.stars, bluesky.posts: 54,164 stars lead the group, while four recent Bluesky links give a weak attention signal.
  • github.com/wojtekmaj/react-pdf/releases/tag/v11.0.0: React-PDF accounts for some installs through its PDF.js dependency.
  • mozilla.github.io/pdf.js/getting_started: Provides direct downloads and CDN distribution outside npm installs.
Vouched for8.9

Who stands behind it being good?

Claude Opus 5.5: 9.0, likely 8.0 to 9.5

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, likely 7.7 to 9.7

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.

Safe7.6

How safe is it to depend on?

Claude Opus 5.5: 7.5, likely 6.5 to 8.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.

  • advisories: Three high-severity advisories, one in the last 24 months.
  • advisories.gitlab.com/npm/pdfjs-dist/CVE-2026-16633: 2026 XSS fixed in 6.2.108. Exploitable with default enableScripting.
  • scorecard: Score 8.3. Signed-Releases 0. CII 0.
  • npm dependencies: No runtime dependencies.

GPT-6.2 Sol: 7.6, likely 6.4 to 8.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

npm downloads, 4 weeks
226M ×11 in a year
GitHub stars
54k
Commits, 12 months
3.2k
npm version
6.5.438 Nov 2026
Versions, 12 months
12
Advisories, 24 months
1 of 3 ever
OpenSSF Scorecard
8.3 out of 10, Oct 2026
Licence
Apache-2.0

Read on 21 November 2026 from GitHub (mozilla/pdf.js), npm (pdfjs-dist), OSV and the OpenSSF Scorecard.

PDF libraries

  1. 8.7PDF.js
  2. 7.6PDFKit
  3. 7.4React-PDF viewer
  4. 7.4unpdf
  5. 7.3React-pdf renderer
  6. 7.2pdfmake
  7. 6.9pdfme
  8. 6.4jsPDF
  9. 4.9pdf-lib
Compare all 9 on six scores