Skip to content
dialegein

pdf-lib

JavaScript library for creating PDFs and filling forms, pages and metadata.

Jobs Edit Merge

Since 2017

Operated by Andrew Dillon

Visit pdf-lib

Opens the vendor's own site.

Jobs covered

Open a task to see exactly what the vendor documentation supports.

Edit Browse all edit tools

loading and modifying an existing PDF with pdf-lib's object-level JavaScript API: adding, inserting, removing, copying and splitting pages; drawing new text, PNG/JPEG images, SVG paths and embedded PDF pages onto pages; creating, filling, reading and flattening AcroForm fields; setting/reading metadata and viewer preferences; adding attachments; and embedding/subsetting fonts. The scope records only these documented structural/content-object operations on existing documents and explicitly excludes reflowing or editing existing body text outside form fields, OCR, redaction, encryption/decryption, digital signatures, accessibility remediation or general word-processor/document editing

Merge Browse all merge tools

merging and splitting PDF pages in JavaScript

Where your files are processed

No server involved

A pure JavaScript library operating on in-memory byte arrays in your own runtime. No vendor service and no runtime downloads, so it can be fully air-gapped. That is a property of the library itself: what an application built with it does with your file depends on that application, not on this.

pdf-lib is an in-process JavaScript library operating on in-memory PDF byte arrays in whatever runtime loads it (Node, browser, Deno or React Native). There is no pdf-lib service, account or built-in network transfer in the documented path; whether the caller loads bytes over a network is the caller's choice, so this is not an absolute no-network guarantee for every application.

What it does

pdf-lib is a dependency-light MIT JavaScript library, currently published as 1.17.1, for creating PDFs and modifying existing ones in Node, browsers, Deno and React Native. It loads an existing PDF and can add, insert, remove and copy pages; draw text, images, SVG paths and embedded PDF pages; create, fill, read and flatten AcroForm fields; set and read metadata and viewer preferences; add attachments; and embed/subset fonts (with fontkit for custom fonts).

It is an object-level PDF construction/manipulation library, not a document editor: it does not reflow or edit existing body text outside form fields, and it has no OCR, redaction, encryption/decryption or digital-signature support. The current published release is 1.17.1 (6 November 2021); the repository was last pushed in July 2024 and still has 318 open issues, so maintenance activity should be checked before a long-lived dependency.

Best for

Projects that need to generate PDFs or programmatically fill, stamp, restructure and annotate existing ones entirely in-process, and that either do not need encryption or will pair it with a separate tool.

Worth knowing

No encryption support: loading an encrypted PDF throws EncryptedPDFError, and there is no API for writing password-protected output. The ignoreEncryption option does not decrypt and the README says not to use it.

It cannot reflow or edit existing body text outside form fields; it can draw new content over pages, manipulate pages/forms/metadata/attachments, but it is not a word processor, OCR engine, redaction tool or general document editor. It has no digital-signature, conversion or accessibility-remediation capability.

The latest published release is 1.17.1 (6 November 2021); the repository was last pushed in July 2024 and has 318 open issues, so this is not a actively maintained release cadence and should be checked before a long-lived dependency. Image support is PNG/JPEG via the library; PDF embedding is supported.

No price applies: MIT, no hosted edition, no account.

Details, and where each comes from

Vendor statements, our own reading of their pages, and the things nobody has established yet, each answered separately. Where we have not confirmed something it says so rather than guessing, and a row nobody has established is greyed out.

Versions covered
Web · Self-hosted
Website
pdf-lib.js.org
Requires an account
Not applicable
Watermark on the free tier
Not verified
Maximum file size
Not verified
Batch processing
Not verified
Data residency
Self-hosted
Open source
Yes
Self-hostable
Yes
Licence
MIT.

MIT. The npm package is authored by Andrew Dillon and the repository is Hopding/pdf-lib.

The current package metadata and README declare MIT; there is no vendor service or commercial edition. Dependencies are pako, tslib, @pdf-lib/upng and @pdf-lib/standard-fonts; font embedding with custom fonts uses the separate fontkit module.

Redaction
No redaction feature
Programmatic access
Embeddable library · Browser JavaScript
Last availability check
Responded in 110 ms 21 October 2026

Checked automatically by our own runner, not reported by the vendor. 100% of our last 30 checks got a response.

What the redaction verdict rests on

From the vendor's own documentation, read 22 September 2026. Not tested by us.

What that does not establish

The vendor’s own site was read on 22 September 2026 and contains no mention of redaction, sanitisation, blackout or whiteout. Absence from a vendor’s own material is not proof that a feature does not exist - it may be undocumented, or on a page the reading did not reach - but for a NEGATIVE claim it is the strongest evidence available, and it is weaker than a positive quote.

Recorded as such rather than presented as certainty.

https://pdf-lib.js.org

What the vendor says

Claims are labelled rather than repeated as fact. Where we have checked something ourselves, it says so and shows when. Checked means we read the vendor's own page and it says what we recorded - not that we tested the behaviour, unless the note says we did.

  • “pdf-lib does not currently support encrypted documents.”

    Checked by us - the source says this Read 22 September 2026

    Confirmed verbatim: "pdf-lib does not currently support encrypted documents." The README continues with the operational detail the claim leaves out and a user needs: "You should not use pdf-lib with encrypted documents. However, this is a feature that could be added to pdf-lib.

    Please create an issue if you would find this feature helpful!" It then documents the behaviour - PDFDocument.load throws on an encrypted document - and the escape hatch, an ignoreEncryption: true option that loads the document anyway. That last part is the practical nuance: the library will read an encrypted file if told to ignore the encryption, which is not the same as supporting encryption and is worth knowing before choosing it for a workflow that involves protected files.

    This is a negative capability claim of the kind this project has settled by inspection before, in the pikepdf API audit; here it was settled by reading the library's own README, and no inspection of the code was performed.

    Standing: Re-read: the text is unchanged, but the page publishes values that move

    Check it yourself: the source, the SHA-256, and how we checked
    From
    the text a browser renders
    SHA-256
    8ab918ba9f32fd9f96d31761b53fffd3e9c4d8b61122f5e1843279646392e1ca

    How we checked

    Re-verified verbatim on 2026-09-22: https://github.com/Hopding/pdf-lib re-rendered in headless Chrome with scripts/render-page.mjs and the claim's wording found in the rendered text. Originally verified on 2026-09-21. sourceHash is the SHA-256 of the re-rendered text, held as rv-github-com-Hopding-pdf-lib-b6cbabb3.txt.

    What this hash proves, and what it does not

  • “Supporting modification (editing) of existing documents.”

    Checked by us - the source says this Read 22 September 2026

    Confirmed verbatim: the sentence appears unaltered in the README's feature list, as one item among several. It is a positive capability claim sitting in the same document as the negative one already recorded - that pdf-lib "does not currently support encrypted documents" - and reading them together is the useful thing: modification is supported, and only for unencrypted files.

    A developer who skimmed this feature list could take "modification of existing documents" as general, when the encryption entry two sections away bounds it.

    Standing: Re-read: the text is unchanged, but the page publishes values that move

    Check it yourself: the source, the SHA-256, and how we checked
    From
    the text a browser renders
    SHA-256
    8ab918ba9f32fd9f96d31761b53fffd3e9c4d8b61122f5e1843279646392e1ca

    How we checked

    Re-verified verbatim on 2026-09-22: https://github.com/Hopding/pdf-lib re-rendered in headless Chrome with scripts/render-page.mjs and the claim's wording found in the rendered text. Originally verified on 2026-09-21. sourceHash is the SHA-256 of the re-rendered text, held as rv-github-com-Hopding-pdf-lib-b6cbabb3.txt.

    What this hash proves, and what it does not

Each claim is quoted from the vendor's own pages. This section describes what we have and have not checked - it is not a judgement about anyone.

Sponsorship is distribution, not an endorsement or a promise of search rankings, AI citations, traffic, or sales. This listing is a free entry, compiled from published sources.

Visit pdf-lib Report a problem

Related reading

How this record was put together

Editorial review.
No editor has signed this record off. That is not the same as nothing having been checked, and the lines below say what has.
Source reading.
2 claims taken from the vendor's own pages, read between 22 September 2026 and 22 September 2026.
Website availability.
The vendor's site was last checked on 21 October 2026.
Behaviour testing.
We ran this ourselves. The file handling was watched directly.

Sources: https://registry.npmjs.org/pdf-lib/latest (1.17.1, MIT, author Andrew Dillon, dependencies; read 2026-10-16); https://github.com/Hopding/pdf-lib (repo, MIT, created 2017-09-04, last push 2024-07-17, 318 open issues; read 2026-10-16); https://github.com/Hopding/pdf-lib/releases/tag/v1.17.1 (latest release, 2021-11-06); https://raw.githubusercontent.com/Hopding/pdf-lib/master/README.md (features, modification, forms/pages/metadata/attachments/fonts, limitations, encryption, tested Node/Browser/Deno/React Native; read 2026-10-16).