Recipes
Short, task-focused examples. The canonical runnable versions live in the repository's examples/ directory and the HTML input fixtures/.
Runnable examples
- Render an invoice —
examples/render-invoice.ts: templating with loops, currency/date helpers, pagination with a repeating<thead>, and strict rejection of out-of-subset input. Walked through in the Invoices guide. - Render a receipt — compact point-of-sale style output with deterministic metadata.
- Render a boleto — structured banking document layout and barcode-like text fixture coverage.
- Render a notification — legal-notice style document with long-form text.
- Stream to an HTTP response — use
renderPdfToStreamwith a writable response. - Bound concurrency — render many documents while capping active native work.
- Custom fonts — pass TTF/OTF bytes through
fonts. - PDF/A output — request
PDF/A-2band handle conformance failures.
HTML Fixtures
The repository ships representative HTML inputs at fixtures/<scenario>/{index.html,data.json}. These scenarios exercise layout capabilities; they are not domain entities or special render modes:
fixtures/invoice/fixtures/receipt/fixtures/boleto/fixtures/notification/fixtures/invoice-broken/— deliberately out-of-subset, to demonstrate strict rejection and fixes.
Guides
For step-by-step how-tos, see Streaming, Images, Fonts, PDF/A, Rendering fidelity, and Concurrency.