Generate native PDF files from JSON and TypeScript.
Install
Terminal
npm install @runstamp/pdf
Requires Node.js >=18.
Quick Start
TypeScript
import { PdfEngine } from "@runstamp/pdf";
import { writeFileSync } from "node:fs";
const buffer = await PdfEngine.render({
meta: { title: "Monthly Update" },
page: { size: "Letter", margin: 48 },
children: [
{ type: "heading", value: "Monthly Update" },
{ type: "paragraph", value: "Revenue grew 18% month over month." },
],
});
writeFileSync("update.pdf", buffer);
Core API
PdfEngine.render(document, options?)— returns aUint8Arrayof the PDF.PdfEngine.renderStream(document, options?)— returns a NodeReadableadapter. The complete PDF is buffered before the stream emits, so it does not reduce peak render memory.
Rendering is native — no Chromium, no Puppeteer — and deterministic for repeatable builds and tests. Supports text, layout, graphics, images, tables, links, and bookmarks.
Hosted and commercial plans
Advanced typography, digital signatures, timestamps, PDF/A, and linearization ship in @runstamp/pdf. Pro and higher plans add managed execution, durable delivery, governance, support, and commercial service terms; there is no separate PDF npm engine to install. See License & Pricing.