// the find
Hopding/pdf-lib
Create and modify PDF documents in any JavaScript environment
pdf-lib is a pure-JavaScript library for creating and modifying PDF documents, with no native dependencies. It works in Node, browsers, Deno, and React Native from the same codebase. If you need to generate or edit PDFs without a server-side binary like Puppeteer or wkhtmltopdf, this is the most practical option in the JS ecosystem.
1. Genuine modification support — most JS PDF libraries can only create from scratch; pdf-lib can load an existing PDF and mutate it, which is the hard part. 2. Zero native dependencies — pure TypeScript/JS means it actually runs in browsers and React Native without bundler gymnastics. 3. Form support is real: create fields, fill them, flatten them — not just cosmetic overlays on top of a PDF. 4. The API is well-designed: async/await throughout, typed return values, and consistent coordinate system (bottom-left origin, points as unit).
1. Last meaningful commit was mid-2024 and the maintainer has explicitly noted reduced capacity — open issues include basic bugs that have sat unpatched for years. 2. No support for password-protected/encrypted PDFs — the library will throw if you try to load one, which is a common real-world scenario. 3. Text layout is entirely manual: you position glyphs at absolute coordinates with no wrapping, no flow, no columns. Building anything beyond a form fill or a watermark requires you to implement text layout yourself. 4. Image support is JPEG and PNG only — no SVG rasterization, no WebP, no GIF, which means you'll hit a wall on any modern web asset pipeline.