Generate precise PDFs
Create pages, draw text and vector paths, embed JPEG/PNG images, attach files, add outlines, and serialize deterministic bytes.
Build, inspect, tag, encrypt, merge, and incrementally edit PDFs with a small public API and browser-friendly Uint8Array output.
zeropdf keeps PDF workflows close to regular TypeScript: you compose a document, add pages and annotations, then write bytes wherever your runtime needs them.
import { createDocument, rgb } from "@criston/zeropdf";
const doc = createDocument({
title: "Invoice"
});
const page = doc.addPage({ size: "A4" });
page.text("Invoice #1007", {
x: 56,
y: 780,
fontSize: 18,
color: rgb(0.13, 0.2, 0.34)
});
const bytes = doc.toUint8Array();Start with the getting started guide, then use the API reference when you need exact option types.