Enterprise PDF for Node.js & TypeScript
The enterprise PDF library
Node doesn't have.
Generate archival PDF/A, sign documents with PAdES, encrypt with AES-256 and produce accessible PDF/UA from Node.js or TypeScript. One memory-safe core, the same behavior as every other binding, running entirely on your servers: no per-document SaaS fees, no data leaving your network, no AGPL strings.
Install from npm. Prebuilt native binaries per platform, no node-gyp.npm install rustpdfWhy Node teams pick rust-pdf
The usual way to make a "real" PDF from Node is to render HTML in headless Chrome with Puppeteer. It works until production: gigabytes of RAM per worker, cold starts, and still no PDF/A, no qualified signatures, no PDF/UA. The alternative is a per-document SaaS that uploads your customers' documents.
rust-pdf is one npm install with prebuilt native binaries
(no node-gyp), TypeScript types included, with every feature free. Replace a fleet of heavy
HTML→PDF servers with a 22 MB native core.
- No headless Chrome: drop Puppeteer and the gigabytes of RAM it needs per worker.
- Runs on your servers: documents never leave your network and nothing phones home, ideal for LGPD/GDPR, fintech and health.
- No AGPL trap: MIT licensed, never the AGPL of iText or the per-server billing of Aspose.
- Typed & deterministic: ships
index.d.ts, and the same input always produces the same bytes. - Free to build with: every feature is free forever.
Every feature is free.
Prototype and ship everyday PDFs for free. PDF/A, signatures, encryption and accessibility are all included in Node and every other binding.
Core free
- Pages & vector graphics
- Embedded/subset fonts, Unicode shaping
- Justified paragraphs & tables
- Images (JPEG/PNG/alpha/16-bit)
- Merge / split / rotate
- Text extraction & optimize
Advanced free
- PDF/A: 1b / 2b / 2a / 3b / 3a / 4 / 4e / 4f archival
- Digital signatures: PKCS#7, visible & multiple
- PAdES: B-B / B-LT / B-LTA + RFC 3161 timestamps
- Encryption: RC4 / AES-128 / AES-256 (R6)
- Accessibility: Tagged PDF / PDF/UA-1
- AcroForm: fields with generated appearances
Every feature is free.
rust-pdf is MIT licensed — PDF/A, digital signatures, encryption, accessibility and page rendering are all included. No key, no account, no card.
Author a PDF/A and encrypt it in a few lines of Node
// npm install rustpdf
const { Document, EditableDoc, Encryption, PdfaLevel } = require("rustpdf");
const doc = new Document();
doc.pdfa(PdfaLevel.A2b).setInfo({ title: "Q3 Report" });
const f = doc.addFontFile("Roboto-Regular.ttf");
doc.addPage();
doc.showText(f, 26, 72, 760, "Invoice #1024");
const bytes = doc.toBytes(); // archival-grade PDF
// Encrypt with AES-256:
const ed = EditableDoc.load(bytes);
ed.encrypt({ owner: "owner-secret", method: Encryption.Aes256 });
ed.save("secured.pdf");
The full Node / TypeScript reference (fonts, images, forms, manipulation, encryption and signatures) lives in the Node docs.
Fits Express, Nest and serverless functions
toBytes() hands you a Node Buffer, so returning a
PDF is res.type("application/pdf").send(buf) in Express, a
StreamableFile in NestJS, or the body of a Lambda / Cloud
Functions response. You delete the Puppeteer fleet and the gigabytes of RAM
it needed per worker.
npm install rustpdf pulls prebuilt native binaries per platform
with no node-gyp, and ships index.d.ts so TypeScript gets full
types. It works the same from CommonJS require and ESM
import.
// Express: stream a PDF/A as the response
import express from "express";
import { Document, PdfaLevel } from "rustpdf";
const app = express();
app.get("/invoice.pdf", (_req, res) => {
const doc = new Document();
doc.pdfa(PdfaLevel.A2b);
const f = doc.addFontFile("Roboto-Regular.ttf");
doc.addPage();
doc.showText(f, 18, 72, 760, "Invoice #1024");
res.type("application/pdf").send(doc.toBytes());
});
Common PDF tasks in Node.js
Focused, copy-paste guides in JavaScript and TypeScript, all on the same Rust core. Each one mirrors the API you already saw above.
- Generate a PDF in Node and sign it with PAdES.
- Create PDF/A in Node and encrypt with AES-256.
- Merge PDFs, extract text and compress.
- Fill PDF forms in Node, plus concept hubs: PDF/A, PAdES, AES-256.
Start building in Node.js
npm install rustpdf and ship your first archival PDF today.
Every feature is free.
Node.js PDF library FAQ
Does it need node-gyp or a native build step?
No. The package ships prebuilt native binaries per platform and loads them through a pure-FFI layer (Koffi), so npm install rustpdf never compiles anything. There is no Chromium download and no Puppeteer dependency.
Does it work with TypeScript, ESM and CommonJS?
Yes. It ships an index.d.ts for full TypeScript types and exports work from both require (CommonJS) and import (ESM). The same Document / EditableDoc shape is used either way.
Is it a good fit for serverless and containers?
Yes. The native core is small and runs fully offline, so cold starts stay low and no document leaves your function. Compared with a headless-Chrome approach, memory per invocation drops sharply, which matters on Lambda and Cloud Run.