OSS Tanbou

pdf-lib — create new PDFs and modify existing documents from JavaScript

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
8,637
Primary language
TypeScript
License
MIT
Repository last updated
Jul 17, 2024

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.

Sources: [2][3]

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.

Sources: [2][4]

Official sources

  1. [1]Hopding/pdf-lib repository(2026-09-21)
  2. [2]pdf-lib README(2026-09-21)
  3. [3]pdf-lib documentation(2026-09-21)
  4. [4]pdf-lib package(2026-09-21)
  5. [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. 1

    Install pdf-lib

    Add pdf-lib to a Node.js or browser project.

    npm install pdf-lib
  2. 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. 3

    Save the PDF bytes

    Use the resulting Uint8Array for file output or browser download.

    page.drawText('Hello PDF'); const pdfBytes = await pdfDoc.save()
Check the official README

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

  • pdf
  • 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
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.