Enterprise-safe architecture
Everything runs in the user's browser. No uploaded invoices, no PDF job queue, no headless browser fleet.
Browser-side document export
A print pipeline for teams that already own their React UI. It reads computed styles from the live browser DOM, then emits selectable text, embedded fonts, real images, pagination, and raster fallbacks through pdf-lib.
Pipeline
No server
0 Chromium
Current bundle
~36 KB ESM
Test coverage
unit + e2e
Everything runs in the user's browser. No uploaded invoices, no PDF job queue, no headless browser fleet.
Tailwind v4, CSS-in-JS, tokens, and resolved CSS all collapse to computed styles before export.
Headers, footers, manual breaks, break-inside avoidance, and repeating table headers are part of the pipeline.
Gradients, shadows, transforms, filters, and SVG regions are captured as PNG fallback regions.
const ref = useRef<HTMLDivElement>(null);
const result = await exportToPDF(ref.current, {
format: "A4",
margin: "20mm",
filename: "invoice.pdf",
header: ({ pageNumber, totalPages }) => (
<div>Page {pageNumber} / {totalPages}</div>
),
});
result.save();