A clean Node.js toolkit for PDF manipulation
A PDF library for Node.js built on pdf-lib: merge multiple PDFs, split pages, extract text, rotate pages and read/write metadata.
What's included
- mergePdfs — combine any number of documents
- splitPdf — split all or selected pages
- extractText — pull text out of a PDF
- rotatePage — rotate any page (normalised angles)
- getMetadata / setMetadata — title, author, page count
- Zero config — ESM + CJS dual build
- 19 passing tests — real in-memory PDFs
Quick Start
npm install
npm run build
node scripts/demo.mjs
Stack
Node.js 18+ · pdf-lib · pure ESM
Use cases
- Document pipelines
- Report assembly
- Invoice processing
- Learning PDF internals