PDF Toolkit — what's new in 1.4.0
pdfnative 1.4.0 adds a document-assembly toolkit: outline bookmarks, page labels, viewer preferences, nested lists, table cell borders & vertical alignment, and a page-tree API to merge / split / extract pages. Every demo below runs entirely in your browser and downloads a real PDF — open it in any compliant viewer (the bookmarks preset is best viewed in a desktop reader with a bookmarks panel).
Also new in 1.4.0, but Node-only (no browser demo):
streamToFile() writes a streamed PDF to disk with back-pressure; a pluggable crypto provider (setCryptoProvider) lets you sign with native constant-time primitives; validateFontData() sanity-checks a font module; and the pdfnative-build-emoji-font CLI generates a colour-emoji module with exactly the glyphs you need.
View underlying code
v1.4.0 features exercised here:
- Outline / bookmarks —
outline: 'auto'derives a bookmark tree from headings; explicitOutlineItem[]supports nesting, bold/italic/colour, and collapsed nodes (open: false). - Page labels —
pageLabelsrenders roman front-matter then decimal body numbering in the viewer's page box. - Viewer preferences —
layout.viewerPreferencesopens the bookmark panel and shows the document title in the window chrome. - Nested lists —
ListItementries nest bullet/numbered sub-lists to any depth. - Table cell borders & vertical alignment —
cellBorders(solid / dashed / dotted) andcellVAlignper table or per column. - Page-tree manipulation —
mergePdfs,splitPdf, andextractPagesrebuild a clean object graph from existing PDFs.
All zero-dependency, all in the browser. The exact same code runs in Node.js, Deno, Bun and Web Workers.