Overview
pdf-lib creates and modifies PDF documents from JavaScript and TypeScript. It supports adding and copying pages, drawing text and images, working with forms, embedding fonts, and saving PDF bytes across Node.js, browsers, Deno, and React Native.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Create PDFs and draw text, images, and pages
Start with PDFDocument.create(), add pages, draw content, and serialize the result to PDF bytes.
Sources: [2]
Load existing PDFs and edit pages, forms, and metadata
Existing documents can be modified through page copying, form filling, attachments, metadata, and viewer preferences.
For document generation and filling workflows
It fits applications that need server- or browser-side PDF creation and modification for reports, contracts, and form workflows.
Sources: [2]
Review release cadence and feature limitations
The latest release and repository activity are relatively old. Test encryption and other advanced PDF requirements against the documented limitations before adoption.
Official sources
- [1]Hopding/pdf-lib repository(2026-09-21)
- [2]pdf-lib README(2026-09-21)
- [3]pdf-lib documentation(2026-09-21)
- [4]pdf-lib package(2026-09-21)
- [5]pdf-lib MIT license(2026-09-21)
Supplemental curator note
The latest GitHub release is 1.17.1 from 2021, and the repository was last pushed in July 2024. Unlike PDF.js, which focuses on viewing and rendering, pdf-lib focuses on document creation and modification. Review README limitations for encryption and other advanced PDF requirements.
Try it in 3 steps
- 1
Install pdf-lib
Add pdf-lib to a Node.js or browser project.
npm install pdf-lib - 2
Create a PDF and page
Create a document and prepare a page for text, images, or other content.
const pdfDoc = await PDFDocument.create(); const page = pdfDoc.addPage() - 3
Save the PDF bytes
Use the resulting Uint8Array for file output or browser download.
page.drawText('Hello PDF'); const pdfBytes = await pdfDoc.save()
Growth
Growth trends · Last 30 days
8,637 Stars
Trend data is still being collected.
Development activity
Last 90 days · weekly
- Commits (last 30 days)
- 0
- Open PRs
- 39
Development activity is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- document
- create
- modify
- creation
- modification
- edit
- editing
- typescript
- javascript
- library
- umd
- Stars
- 8,637
- Forks
- 914
- Watchers
- 63
- Open issues
- 278
- Contributors
- 32
- Primary language
- TypeScript
- License
- MIT
- Repository last updated
- Jul 17, 2024
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Documenso15,122 Stars
2 shared tag(s) · Same language
A self-hostable DocuSign alternative for sending PDF documents, placing fields, collecting recipient signatures, and automating signing workflows.
TypeScript - Visual Studio Code192,752 Stars
1 shared tag(s) · 1 shared category(s) · Same language
The MIT-licensed Code - OSS repository that forms the open foundation of Visual Studio Code.
TypeScript - Supabase110,464 Stars
1 shared tag(s) · 1 shared category(s) · Same language
An open Postgres development platform combining Database, Auth, APIs, Realtime, Storage, and Functions.
TypeScript - Pi107,901 Stars
1 shared tag(s) · 1 shared category(s) · Same language
A minimal and extensible harness for AI coding agents.
TypeScript - Tailwind CSS97,630 Stars
1 shared tag(s) · 1 shared category(s) · Same language
A CSS framework for building custom interfaces by composing utility classes.
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.