Overview
PDF.js is a Mozilla-supported PDF viewer platform implemented in JavaScript and web standards. Applications can use the complete viewer or integrate lower-level display APIs such as `getDocument` into a custom experience.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Load documents and render individual pages
getDocument opens a PDF and exposes page-level information and rendering operations for custom viewers.
Choose the complete viewer or lower-level display APIs
Projects can adopt the viewer UI or use pdfjs-dist APIs to build only the rendering and navigation features they need.
Sources: [2]
For embedded PDF viewing, search, and navigation in web applications
It fits applications that need PDF presentation and interaction integrated into their browser UI.
Sources: [2]
Plan worker delivery, browser support, and bundle size
Production integration needs correct worker configuration, modern/legacy build choices, and memory considerations for large PDFs. It is not a PDF editing library.
Official sources
- [1]mozilla/pdf.js repository(2026-09-21)
- [2]PDF.js README(2026-09-21)
- [3]PDF.js getDocument example(2026-09-21)
- [4]PDF.js development package metadata(2026-09-21)
- [5]PDF.js Apache-2.0 license(2026-09-21)
Supplemental curator note
The latest GitHub release is 6.3.289. The repository is the development source tree; application consumers normally use the prebuilt `pdfjs-dist` package. PDF.js focuses on parsing and viewing PDFs, which is distinct from creation/editing libraries such as pdf-lib.
Try it in 3 steps
- 1
Install the distribution package
Application consumers normally use the prebuilt pdfjs-dist package rather than the repository source tree.
npm install pdfjs-dist - 2
Import the Node document loader
Use the same API path demonstrated by the official Node example.
import { getDocument } from 'pdfjs-dist/legacy/build/pdf.mjs' - 3
Inspect the page count
Verify parsing first; browser viewer integration additionally needs worker configuration.
const pdf = await getDocument('sample.pdf').promise; console.log(pdf.numPages)
Growth
Growth trends · Last 30 days
53,903 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 277
- Open PRs
- 60
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
- Stars
- 53,903
- Forks
- 10,686
- Watchers
- 1,096
- Open issues
- 370
- Contributors
- 387
- Primary language
- JavaScript
- License
- Apache-2.0
- Repository last updated
- Sep 20, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- React250,613 Stars
1 shared tag(s) · 1 shared category(s) · Same language
A JavaScript library for building web and native user interfaces from declarative components.
JavaScript - Node.js122,023 Stars
1 shared tag(s) · 1 shared category(s) · Same language
A cross-platform JavaScript runtime for servers, CLIs, and tooling, with clearly separated Current and LTS release lines.
JavaScript - Axios109,206 Stars
1 shared tag(s) · 1 shared category(s) · Same language
A Promise-based HTTP client for browsers and Node.js with interceptors, adapters, cancellation, and transport controls.
JavaScript - Svelte88,157 Stars
1 shared tag(s) · 1 shared category(s) · Same language
A web UI framework that compiles declarative components into efficient JavaScript and makes reactivity explicit with runes.
JavaScript - Prettier52,287 Stars
1 shared tag(s) · 1 shared category(s) · Same language
An opinionated formatter that parses source code and reprints it into a consistent layout.
JavaScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.