v0.2.0 — First implemented release
pdfnative-react v0.2.0 — First implemented release
This is the first functional release of pdfnative-react, the declarative
React renderer for the pdfnative
PDF engine. (v0.1.0 only reserved the package name.)
Highlights
- Write PDFs as components. A custom React reconciler compiles your JSX tree
— synchronously, with no DOM — into apdfnativeDocumentParamsobject and
renders real PDF bytes. - Declarative block flow, honestly modelled. Components map 1:1 onto the
pdfnative blocks. There is intentionally no<View>/flexbox engine. - Full block coverage:
Document,Page,Heading,Paragraph/Text,
List/Item,Table/Row/Cell,Image,Link,Spacer,PageBreak,
TableOfContents/Toc,Barcode,Svg, andFormField. - Four render targets:
renderToBytes,renderToBlob,renderToStream
(true constant-memory streaming), andrenderToFile(Node). - React hooks & preview components:
usePdf,usePdfStream,PDFViewer,
PDFDownloadLink, andBlobProvider— familiar to@react-pdf/renderer
users for easy migration. - Token-frugal AI authoring: a compact
DocSpecgrammar (compileSpec,
renderSpec*) that compiles to the same PDF as the equivalent JSX, with a
versioned Draft 2020-12 JSON Schema (docSpecSchema()) for self-validation. - Exhaustive, type-checked
samples/covering every 0.2.0 capability, plus
a CycloneDX SBOM attached to each release and provenance-signed npm publishes. - Typed, tested, tree-shakeable: strict TypeScript, dual ESM + CJS builds,
source maps, and a tested public surface.
Quick start
npm install pdfnative-react pdfnative reactimport { Document, Heading, Paragraph, renderToBytes } from 'pdfnative-react';
const bytes = renderToBytes(
<Document title="Hello">
<Heading>Invoice</Heading>
<Paragraph>Thank you for your business.</Paragraph>
</Document>,
);Requirements
- React
^19.0.0 - Node.js
>=20
Notes
- React 18 support is planned (see ROADMAP.md).
- See the Knowledge Base for the compile pipeline
and the react-reconciler version contract.
Full changelog: CHANGELOG.md.