HTML to PDF.
No Chromium.
A clean TypeScript wrapper over html-to-pdfmake and pdfmake. Templates, watermarks, QR codes, merge and split — wired into one ergonomic call.
- install
- 106 MB vs 300 MB Puppeteer
- cold start
- ~ 240 ms Lambda baseline
- footprint
- 0 MB of Chromium
Q4 Reconciliation
Bill to Halberd & Folk Atelier
Wires due 14 days from issue · USD
Everything you reach for, in one call.
The pipeline is small on purpose. The features that ship are the ones teams ask for again and again — wired in, typed end-to-end, and lazy where it matters.
- page.size'A4'
- watermark'DRAFT'
- header(page) => …
- pageNumber{ placement: 'footer' }
- metadata.title'Q4 Report'
- protect{ userPassword }
Configure once, reuse everywhere
Per-call options deep-merge with stateful HtmlPdfForge defaults. Twelve fields, one ergonomic call.
<pdf-qr value="…" ec="M" />QR codes that just embed
Drop <pdf-qr> into your HTML. Lazy-loaded — plain pages never pay the cost.
Watermarks & protection
Diagonal text watermarks, owner / user passwords, granular permission flags.
Merge & split, deterministic
Combine PdfResults, Buffers, or file paths interchangeably. Extract page ranges with 1-indexed precision.
Trade pixel-perfect for predictable.
Reach for Puppeteer when you need flexbox, grid, or web fonts via @font-face URL. Reach for forge when you need fast, reproducible output and don't want a Chromium tax on every cold start.
// Determinism wins for invoices, reports, contracts, anything that has to byte-match across runs.
The smallest call you'll make all week.
No printer wiring, no stream plumbing, no jsdom boilerplate. Pass HTML, get a typed PdfResult with five output methods.
import { htmlToPdf } from '@rexymayderio/html-pdf-forge';
const pdf = await htmlToPdf(
'<h1>Hello</h1><p>From html-pdf-forge.</p>',
);
await pdf.saveToFile('./hello.pdf');