Migrate from react-pdf¶
Keep your data interfaces and component boundaries. Decide whether you want to stay with JSX or move to semantic HTML for print CSS and table pagination.
| Current component | Native PressJet JSX | React HTML adapter |
|---|---|---|
Document and Page |
Document and Page from pressjet |
HTML document and @page |
View |
View with supported flexbox styles |
Use semantic HTML or a div with print CSS |
Text and Image |
Text and Image |
A heading, paragraph, or img |
| Fixed block and page numbers | fixed and pageNumberText |
Running elements and page counters |
Choose an adapter¶
For native JSX, set jsxImportSource to pressjet and review the supported node and style properties. For semantic HTML, keep your React data props and use the WASM React adapter. With either route, check font family and weight mapping before comparing page breaks.
With jsxImportSource set, a small native component looks like this:
import { Document, Page, Text } from "pressjet";
export function Receipt({ total }: { total: string }) {
return (
<Document title="Receipt">
<Page size="A4" style={{ padding: 36 }}>
<Text style={{ fontSize: 18 }}>Receipt</Text>
<Text>Total paid {total}</Text>
</Page>
</Document>
);
}
Pass the result to the local Node.js renderer or the HTTP client.
Verify the longest variant¶
Start with a fixture that spans at least two pages. Compare repeated headers, text flow, and element positioning using the paired-render sample. Review font warnings and test long values before switching production traffic.