Introduction
A PDF layout engine for Node.js, written in Rust.
npm install @inkoxide/renderTypeset documents from React components, or from a JSON document tree.
Inkoxide does the typesetting of a PDF: text shaping, line breaking, layout, pagination and PDF
output, in native code. Documents are written as React components with
@inkoxide/render, styled with Tailwind
classes or style objects, or built as JSON by any program and rendered with
inkoxide. A one-page invoice renders in about a
millisecond; a 98-page report with 40 tables in about 130 ms.
Features
- Typesetting. OpenType shaping, justification, hyphenation with TeX patterns, orphans and widows, font fallback and right-to-left text.
- Layout. Flexbox and CSS grid, absolute positioning, transforms, borders and radii.
- Pagination. Tables that split across pages with repeating header rows, headers and footers, page numbers, keep-together blocks and page breaks.
- Content. JPEG, PNG, GIF, WebP and SVG images, vector drawing, links, bookmarks, fillable form fields and text notes.
- Output. Font subsetting (TrueType and CFF), PDF/A-1b, 2b and 3b, AES-256 encryption with passwords and permissions, parallel rendering across pages, and byte-identical output for identical input.
- Validation. Every document is checked against a JSON Schema, with the path of each error. In React, errors carry the component stack.
Performance
Median render times after warm-up:
| Document | Pages | All cores | One thread | Machine |
|---|---|---|---|---|
| Invoice, from React | 1 | 1.5 ms | 1.2 ms | Apple M4 Pro, Node 24 |
| Report, from React: 40 sections, 1,000 table rows | 43 | 41 ms | 54 ms | Apple M4 Pro, Node 24 |
| Report, from React, in the browser (WebAssembly, in a worker) | 43 | 56 ms | Apple M4 Pro, Chromium 153 | |
| Report, from JSON: 40 tables, header, footer | 98 | 130 ms | 277 ms | 4-vCPU Xeon container |
Layout and PDF writing run in parallel across pages, and fonts are parsed once per process. Benchmarks has the methodology and per-stage profiles.
Synced from README.md in the inkoxide repository.