PDF.js

Mozilla's HTML5-based library for parsing and rendering PDF documents in the browser and Node.js.

Library
npm
v6.4.299
54,038 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
94 /100 Excellent
Development Activity 100
Maintenance 84
Community 92
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 92
Code Quality 93
Innovation 88
Learning Curve 80

PDF.js is a community-driven, Mozilla-supported JavaScript library that parses and renders Portable Document Format (PDF) files entirely with web standards, requiring no native plugins. Distributed on npm as pdfjs-dist, it powers Firefox’s built-in PDF viewer and countless web applications that need to display, inspect, or extract content from PDFs.

The library exposes a document API for loading PDFs and rendering their pages to an HTML5 canvas, along with text-layer and annotation-layer building blocks for selectable text, links, and interactive form fields. Heavy parsing runs in a Web Worker so the main thread stays responsive, and the package ships both modern and legacy builds to support a wide range of browsers.

What You Get

  • A prebuilt distribution (pdfjs-dist) with pdf.js and a separate pdf.worker for off-main-thread parsing
  • A promise-based document/page API (getDocument, page.render) for loading and rendering PDFs to canvas
  • Text-layer and annotation-layer helpers for selectable text, hyperlinks, and interactive form fields
  • Modern and legacy build variants covering both current and older browser targets
  • A complete, ready-to-embed generic web viewer plus a large collection of usage examples

Common Use Cases

  • Embedding an in-browser PDF viewer without relying on native browser plugins
  • Rendering PDF pages to canvas or images for previews and thumbnails
  • Extracting text content from PDFs for search, indexing, or accessibility
  • Displaying and filling interactive PDF forms and annotations in a web app

Under The Hood

Architecture — PDF.js is split across three source layers under src/: core/ parses the raw PDF byte stream (objects, xref tables, fonts, CMaps, content-stream operators, image and stream decoders in files like document.js, parser.js, and crypto.js), display/ turns parsed operator lists into rendered output via api.js (the public getDocument/PDFDocumentProxy/PDFPageProxy surface) and canvas.js (the 2D canvas renderer), and shared/ holds constants and utilities used by both. The expensive parsing work runs inside a Web Worker (pdf.worker.js), communicating with the display layer over a structured message transport so the UI thread only receives operator lists to paint. Text and annotation layers (text_layer.js, annotation_layer.js) are rendered as DOM overlays aligned to the canvas.

Tech Stack — The library is written in modern JavaScript (ES modules, "type": "module") with no runtime dependencies in the published package. The build pipeline uses Gulp, Webpack, and Babel (with core-js polyfills for the legacy build) to bundle src/ into the production pdf.js/pdf.worker.js scripts; TypeScript declaration files are generated via tsc for typed consumers. Node.js 22.13+ or 24+ is required for development. Localization uses Fluent, and native canvas rendering for Node tests goes through @napi-rs/canvas.

Code Quality — The repository has an extensive test suite: 71 unit-test modules under test/unit/, plus Puppeteer-driven integration tests, reference (pixel-comparison) tests, and font tests, all wired into GitHub Actions with Codecov coverage tracking across three workflows. Code is linted with ESLint (including no-unsanitized and regexp plugins), formatted with Prettier, and style-checked with Stylelint. With over 23,000 commits and 500+ contributors over more than a decade, the codebase is mature and rigorously maintained.

API Design — The public API is deliberately small and promise-based: getDocument(src) returns a loading task resolving to a document proxy, doc.getPage(n) returns a page proxy, and page.render({ canvasContext, viewport }) paints it. Worker setup is handled by assigning GlobalWorkerOptions.workerSrc, the one piece of required boilerplate. The API is thoroughly documented at mozilla.github.io/pdf.js/api and backed by interactive examples and an examples folder covering components, image decoders, Node usage, and webpack integration, which flattens the otherwise steep learning curve of working with a format as complex as PDF.

Used by 47 apps in this directory

TypeScript
96%
MIT

Orca

AI Agents · AI Code Assistants

104,104

An open-source Agent Development Environment that orchestrates fleets of parallel AI coding agents — Claude Code, Codex, Gemini and more — each running in its own isolated git worktree.

View details
84
Repo Health
85
Technical
74
Dependency
Built with
TypeScript 96%
Updated 2 days ago
JavaScript
64%
AGPL 3.0

overleaf

Collaboration · Productivity

18,266

Open-source, real-time collaborative LaTeX editor with sandboxed compilation and full TeXLive support for self-hosted academic and research teams.

View details
84
Repo Health
80
Technical
59
Dependency
Built with
JavaScript 64%
TypeScript 30%
Updated 1 months ago
Python
63%
GPL 3.0

Paperless-ngx

Bookmarks Archiving

47,038

Turn your paper pile into a searchable digital archive with OCR, AI classification, and automated workflows — all running on your own server.

View details
91
Repo Health
88
Technical
67
Dependency
Built with
Python 63%
TypeScript 28%
Updated 2 days ago
Go
68%
MIT

Probo

Automation · Security

1,476

Open-source GRC platform for engineering and security teams.

View details
87
Repo Health
90
Technical
69
Dependency
Built with
Go 68%
TypeScript 30%
Updated 3 days ago
TypeScript
47%
Other

Stirling PDF

Digital Signiture · Productivity

94,824

The open-source PDF platform you can run anywhere — edit, convert, sign, and automate PDFs without sending files to external servers.

View details
92
Repo Health
86
Technical
68
Dependency
Built with
TypeScript 47%
Java 44%
Updated 2 days ago
TypeScript
96%
Other

superglue

AI Agents · Data Engineering · Developer Tools

2,066

superglue is an AI-agent-driven integration engine that turns plain-English descriptions of enterprise systems into production-grade API tools, ERP/CRM connectors, and data pipelines — self-hosted or cloud, Y Combinator-backed (W25).

View details
42
Repo Health
79
Technical
67
Dependency
Built with
TypeScript 96%
Updated 2 months ago
TypeScript
48%
MIT

supermemory

AI Development · AI Memory · Note Taking

31,370

The state-of-the-art memory and context engine for AI agents — ranked #1 on all three major AI memory benchmarks.

View details
88
Repo Health
82
Technical
67
Dependency
Built with
TypeScript 48%
MDX 32%
Python 17%
Updated 2 days ago
Python
71%
Apache 2.0

SurfSense

AI Assistants · Search

16,586

The open-source, unlimited NotebookLM alternative with real-time collaboration, a desktop app, and no vendor lock-in.

View details
88
Repo Health
71
Technical
66
Dependency
Built with
Python 71%
TypeScript 27%
Updated 2 days ago
TypeScript
67%
Other

TaskView

Productivity · Project Management

1,367

Self-hosted project and task management platform for software teams, with Kanban boards, sprints, time tracking, GitHub/GitLab integrations, and an MCP server for AI assistants.

View details
78
Repo Health
77
Technical
68
Dependency
Built with
TypeScript 67%
Vue 21%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers