Skip to content

v0.2.0 — First implemented release

Choose a tag to compare

@Nizoka Nizoka released this 14 Jun 08:10
· 17 commits to main since this release
6ca7371

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 a pdfnative DocumentParams object 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, and FormField.
  • Four render targets: renderToBytes, renderToBlob, renderToStream
    (true constant-memory streaming), and renderToFile (Node).
  • React hooks & preview components: usePdf, usePdfStream, PDFViewer,
    PDFDownloadLink, and BlobProvider — familiar to @react-pdf/renderer
    users for easy migration.
  • Token-frugal AI authoring: a compact DocSpec grammar (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 react
import { 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.