Skip to content
Inkoxide

Search covers every page and heading of the docs. Use ↑ ↓ and ↵.

Introduction

A PDF layout engine for Node.js, written in Rust.

npm install @inkoxide/render

Edit this page

Typeset 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:

DocumentPagesAll coresOne threadMachine
Invoice, from React11.5 ms1.2 msApple M4 Pro, Node 24
Report, from React: 40 sections, 1,000 table rows4341 ms54 msApple M4 Pro, Node 24
Report, from React, in the browser (WebAssembly, in a worker)4356 msApple M4 Pro, Chromium 153
Report, from JSON: 40 tables, header, footer98130 ms277 ms4-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.