# pdf-lib

> Create and modify PDF documents in any JavaScript environment.

Source: https://talira.ai/catalog/pdf-lib-80dtat8x
Every listing: https://talira.ai/catalog.md

Status: pdf-lib looks abandoned: nothing has changed since November 2021, and its makers haven't said it has ended. No release since 1.17.1 (6 Nov 2021) and no commits since November 2021; Cantoo, which maintains the @cantoo/pdf-lib fork, says the owner no longer answers and the project is on hold. Source: https://registry.npmjs.org/pdf-lib

- Kind: Open source
- Types: Library
- Categories: [documents / pdf / manipulation](https://talira.ai/categories/documents/pdf/manipulation), [documents / pdf / forms](https://talira.ai/categories/documents/pdf/forms), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Platforms: web, linux, macos, windows, ios, android
- Licence: MIT[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Self-hostable: yes

pdf-lib is a [TypeScript](https://talira.ai/catalog/typescript-w0asrgz8.md) library, compiled to pure JavaScript with no native dependencies, that creates new PDFs and edits existing ones in browsers, Node, Deno and React Native. It can draw text, images and SVG paths, embed fonts and pages from other PDFs, add, remove, split and merge pages, and create, fill, read and flatten AcroForm fields (text, checkboxes, radio groups, dropdowns, option lists). Unlike most JS PDF libraries it focuses on modifying documents you already have. It cannot open encrypted PDFs, and the last release (1.17.1) was in November 2021. Cantoo maintains a fork with the same API, [@cantoo/pdf-lib](https://talira.ai/catalog/cantoo-pdf-lib-2fgqrykx.md).

## Links

- Website: https://pdf-lib.js.org/
- GitHub: https://github.com/Hopding/pdf-lib
- Docs: https://pdf-lib.js.org/docs/api/

## Problems it solves

- fill in the fields of an existing PDF form from JavaScript without a server round trip
- I need to stamp a name and date onto page 1 of a PDF the user uploads, right in the browser
- merge several PDFs into one file in Node without shelling out to a command-line tool
- my React app has a fillable PDF and I want to set the checkbox and text field values programmatically
- flatten a filled-in form so people cannot edit the answers afterwards
- add a watermark or page numbers to every page of a PDF someone else made
- split a big PDF into separate files per page in a Cloudflare Worker or Lambda
- read which values are already filled in on a PDF form
- embed a custom TTF font and a PNG logo into an existing document
- copy pages from one PDF into another and reorder them
- need a PDF editing library with zero native dependencies that also runs in Deno and React Native
- turn a plain PDF into a fillable one by adding text fields and checkboxes from code

## Features

- Create PDFs from scratch or modify existing ones
- Draw text, images and SVG paths
- Embed TrueType/OpenType fonts and PNG/JPEG images; measure text
- Embed and draw pages from other PDFs
- Add, insert, remove, split and merge pages
- Create, fill, read and flatten AcroForm fields (text, checkbox, radio, dropdown, option list)
- File attachments and document metadata
- No native dependencies

## Limitations

- Doesn't open or edit encrypted PDFs: PDFDocument.load throws an EncryptedPDFError[^1]
- Doesn't extract plain text from a page outside form fields: it reads the values of text fields only[^1]

## Capabilities

- Has official SDKs: plan not known

## Trust

Overall: 0.14 out of 1.
Signals: maintenance 0.00, adoption 0.79, momentum 0.57, community 0.62, backing 0.00, extensibility 0.00.

- latest release v1.17.1 5.1 years ago
- 8.7k GitHub stars
- 35 contributors
- accepts sponsorship (Github)

Warnings:

- abandoned: not maintained since November 2021
- last commit 2.4 years ago

## Forks

- [@cantoo/pdf-lib](https://talira.ai/catalog/cantoo-pdf-lib-2fgqrykx.md): An actively maintained fork of pdf-lib: create and modify PDF documents in any JavaScript environment. Its own project since 2021.
- [@pdfme/pdf-lib](https://talira.ai/catalog/pdfme-pdf-lib-zn1g1rkg.md): This version is forked from Hopding/pdf-lib, with several bug fixes and additional features. 3 changes.

## Alternatives

- [HexaPDF](https://talira.ai/catalog/hexapdf-0yspeq5s.md): Versatile PDF creation and manipulation for Ruby
- [pdfcpu](https://talira.ai/catalog/pdfcpu-ctccs8g5.md): PDF tooling for Go and the command line
- [DocSpring](https://talira.ai/catalog/docspring-kjdwby1j.md): Fill PDF forms, generate PDFs and Word documents, and collect e-signatures with one API.
- [pdftk (PDFtk Server and pdftk-java)](https://talira.ai/catalog/pdftk-pdftk-server-and-pdftk-java-gzz4se9m.md): A command-line tool for working with PDFs
- [Apache PDFBox](https://talira.ai/catalog/apache-pdfbox-79k8kxaj.md): The Apache PDFBox library is an open source Java tool for working with PDF documents.
- [@cantoo/pdf-lib](https://talira.ai/catalog/cantoo-pdf-lib-2fgqrykx.md): An actively maintained fork of pdf-lib: create and modify PDF documents in any JavaScript environment

## Sources

[^1]: https://github.com/Hopding/pdf-lib (checked 20 Nov 2026)
[^2]: https://github.com/Hopding/pdf-lib/blob/master/LICENSE.md (checked 20 Nov 2026)
