Axonpack

Overview

Create PDF files from React components, in Node, in the browser and in a Web Worker.

@axonpdf/react turns React components into PDF files. You build the document from components such as Document, Page, View and Text, lay it out with flexbox, and render it to a file, a stream, a Blob or a viewer. Layout and PDF writing run in a Rust engine, with Yoga for flexbox, compiled to WebAssembly, which is published on its own as @axonpdf/core.

npm install @axonpdf/react react
v0.0.6Released 24 November 2026What changed →
import { Document, Page, Text, renderToFile } from '@axonpdf/react';

await renderToFile(
  <Document title="Hello">
    <Page size="A4" style={{ padding: 40 }}>
      <Text>Hello</Text>
    </Page>
  </Document>,
  'hello.pdf',
);

What it does

FeatureWhat you getPage
ComponentsDocument, Page, View, Text, Link, Image, Canvas, SVG and fillable form fieldsComponents
StylesFlexbox, borders, transforms, media queries, floats and bidirectional textStyling
FontsTrueType, OpenType, WOFF and WOFF2, embedded as subsets, with hyphenation and emojiFonts
RenderingFiles, buffers and streams in Node; Blobs, a viewer and a download link in the browserRendering
StreamingEach page is written to the file or stream as soon as it is laid outRendering
RowsRows from an array or an async iterable, rendered and written in batchesLong documents
PageNumber, PageCountThe page number and count as textaxonpdf extras
TablesTable with a header row that repeats on every page and borders that collapseaxonpdf extras
Header and footer bandsheader and footer on Page, and the content area shrinks to fit themaxonpdf extras
Web WorkerThe whole render off the page's main threadWeb Worker
Profilerprofile() reports time per phase and per page, and memoryProfiling
Security and archivingPasswords, permissions and PDF/ASecurity and archiving
EngineLayout and PDF writing in Rust, with Yoga for flexbox, compiled to WebAssemblyCore engine

Coming from react-pdf? Its API is compatible, and Migrate from react-pdf shows how to switch with one import.

Performance

In Chrome on an Apple M4, on 2026-11-23, the live benchmark app rendered a shipping ledger built as one <Page> per section, with each engine in a Web Worker. Each cell is the time to the finished PDF, then the worker's peak JavaScript heap:

Pagesaxonpdfreact-pdf 4.9.0
1000.90 s, 11.6 MB2.8 s, 192.5 MB
5004.1 s, 55.9 MB45.8 s, 2230 MB
200015.9 s, 141.6 MBno PDF after 10 min, 3158 MB when stopped

The benchmarks page has the full tables, including the same report in one flowing <Page>. You can run the live app yourself at axonpdf-demo.axonpack.dev.

An earlier run, in Node on 2026-11-21, rendered a report in one flowing <Page>. Each cell is the render time, the peak memory of the whole process, and the size of the PDF:

Engine100 pages1000 pages5000 pages
axonpdf, rows as an array817 ms, 117 MB, 442 KB7.8 s, 154 MB, 4.3 MB39.2 s, 471 MB, 21.5 MB
axonpdf, rows from a generator863 ms, 117 MB, 442 KB7.8 s, 130 MB, 4.3 MB39.2 s, 215 MB, 21.5 MB
axonpdf, rows in <Rows>527 ms, 129 MB, 447 KB4.8 s, 147 MB, 4.3 MB24.1 s, 259 MB, 21.7 MB
react-pdf 4.9.036.1 s, 1289 MB, 643 KBstopped at 15 minnot run
pdfkit 0.21.0145 ms, 97 MB, 357 KB1.1 s, 175 MB, 3.5 MB5.3 s, 347 MB, 17.3 MB

pdfkit draws the same pages by hand with page breaks worked out in advance, so read its row as a lower bound. Benchmarks has the method, the commit and the command that reruns every row.

For AI agents

The axonpack agent skill reads these docs, so your coding agent can set axonpdf up from them. Agent skill has the command for each package manager.

npx skills add axonpack/skills

Packages

PackageWhat it is
@axonpdf/reactThe components, styles, fonts and render functions. Most apps need only this one.
@axonpdf/coreThe engine as WebAssembly, for writing a binding for another framework. See Core engine.

On this page