Skip to content

React PDF renderer alternative

React PDF Renderer Alternative for Teams Whose Invoices Outgrow View and Text Primitives

@react-pdf/renderer is a good library until the document has to match a page your app already shows. Then you are maintaining two layouts: the HTML and CSS of the screen, and a second tree of View and Text elements with its own flexbox subset, its own fonts and its own page break rules. A React PDF renderer alternative keeps one layout. Your server renders the HTML your React app already produces in managed Chromium, and the PDF comes back identical to Chrome.

  • PDF and archive in one call
  • Plans from $49 a month
  • Your HTML stays yours

Short answer

The best React PDF renderer alternative for invoices, statements and reports that must look like the web view is a Chromium based renderer called over HTTP. @react-pdf/renderer does not print HTML. It lays out its own primitives with a limited CSS subset, so every screen needs a parallel PDF component. Rendering the real page in Chromium reuses your CSS, Tailwind classes and web fonts, and an archive=true call keeps a dated copy of every PDF you issue.

Written and fact checked by the SitePDF team.

@react-pdf/renderer against self-hosted Chromium and a rendering API, on what decides the choice

The react-pdf library and Puppeteer are open source. SitePDF figures come from our pricing page. The rows that usually decide it are the first three: how much of your existing UI you can reuse, and what happens to long tables.

@react-pdf/renderer Self-hosted headless Chromium SitePDF API
Source of the layout A separate tree of Document, Page, View and Text components The HTML and CSS you already ship The HTML and CSS you already ship
Reuse of your CSS, Tailwind, design system No. Styles are re-written in its StyleSheet subset Full Full
Output matches the browser Only if you rebuild each screen by hand Yes Yes
Long tables and page breaks Manual wrap and break props, header repeat needs care CSS break rules, repeated table headers CSS break rules, repeated table headers
Where it runs In the browser or in Node Your server, with a browser you patch and scale Managed Chromium, one HTTP call
JavaScript, charts, web components No, only its own primitives Yes Yes, with a wait condition
License and cost MIT, free Free plus servers and engineering time Commercial API, from $49/mo for 10,000 renders, $99/mo for 50,000
Dated archive of every render No No Yes. archive=true, retention by plan tier

react-pdf is the better tool for a document with no web equivalent: a shipping label, a certificate, a fixed form. It runs with no server and no per-render cost.

When @react-pdf/renderer is still the right tool

If the PDF is its own artifact, with no screen that has to match it, react-pdf is hard to beat. You write React components, you get vector text and embedded fonts, and it runs in Node or in the browser with no infrastructure and no bill. A certificate, a label sheet or a single page form is a good fit. It is also reasonable when a document must be produced entirely in the browser and nothing may be sent to a server. For the library itself, the react-pdf documentation lists exactly what its style subset covers.

Where it stops for a product that sends invoices

Two layouts for one document. The invoice page in your app is HTML. The PDF is a different component tree. Every design change, every new tax line, every translated label is made twice, and the two drift. Teams usually notice when a customer sends a screenshot of the web view and asks why the PDF differs.

CSS you cannot carry over. react-pdf supports a flexbox subset and a set of style properties, not CSS as a browser reads it. Grid, pseudo elements, media queries, CSS variables and your Tailwind utility classes do not apply, so the styles are rewritten by hand.

Long tables. Statements with hundreds of line items need explicit wrapping and break handling, and repeating a table header across pages takes care. A browser prints a thead on every page when CSS asks for it. See the page break guide for the rules that apply to a Chromium render.

Fonts. Fonts must be registered by file, and complex scripts need extra work. A browser uses the web fonts your page already loads.

What moving to a rendering API looks like

You stop describing the PDF and start posting the page. If your app is React on Next.js, the invoice route already renders HTML on the server. Fetch that HTML (or hand over the URL), send it to the API and store the link that comes back. The invoice component you show on screen becomes the PDF, with a print stylesheet for page size and margins. The Next.js PDF generator and React to PDF pages walk through the client side alternatives and why a screenshot of the DOM is a poor substitute for a real print.

The migration is mostly deletion. The parallel component tree goes, the style subset goes, and the font registration goes. What stays is one print stylesheet.

A worked example with numbers

Take a React SaaS that issues 15,000 invoice PDFs a month. These are planning assumptions, not measurements, so replace them with your own. The team keeps a react-pdf invoice next to the web invoice. Each design or tax change takes about 3 hours on the web view and 4 hours on the react-pdf tree, and there are 6 such changes a year. At $100 an hour the second layout costs 6 x 4 x $100 = $2,400 a year, before the day or two lost each time a customer reports a mismatch.

Moving to the API is a one-off of about 8 hours ($800) to build a print stylesheet and swap the call. A plan for 50,000 renders a month is $99 on monthly billing, $1,188 a year. Year one is about $1,988 against $2,400, and from year two it is $1,188 against $2,400 plus whatever the mismatches cost. If your invoice almost never changes, the gap closes and staying with react-pdf is a sound decision. Time your last real change to see which side you are on.

Keeping proof of what you sent

An invoice or a statement is a document a customer may dispute months later. With archive=true every render is stored with its date, so you can retrieve the exact PDF you issued on that day. A library running in your own code gives you the file, and whatever storage you build around it. The invoice PDF API guide shows the full flow, and if you also want to compare hosted services, the best HTML to PDF API roundup does it on one table.

Teams that present billing results in reports sometimes pair these PDFs with a deck builder such as Docslide, which turns reports and documents into presentations for the quarterly review.

A Next.js route handler: fetch the invoice page you already render, get a selectable-text PDF and an archived copy.
// app/api/invoices/[id]/pdf/route.ts
export async function POST(_req: Request, { params }: { params: { id: string } }) {
  const html = await (await fetch(`${process.env.APP_URL}/invoices/${params.id}/print`)).text();

  const res = await fetch('https://api.sitepdf.com/v1/render', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.SITEPDF_KEY}`,
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    body: new URLSearchParams({ html, format: 'A4', archive: 'true' }),
  });

  return Response.json(await res.json()); // contains the PDF URL
}

This is the documented API call shape. Full request and response walkthrough.

Questions about this job

What is the best alternative to @react-pdf/renderer?
For documents that must match a page in your app, a Chromium based renderer is the best fit, because it prints the HTML and CSS you already have. For standalone documents such as labels or certificates, react-pdf itself is hard to beat. An API like SitePDF removes the browser you would otherwise host.
Does react-pdf support Tailwind or CSS grid?
No. It uses its own StyleSheet with a flexbox subset and a limited set of properties. Tailwind classes, CSS grid, variables and media queries do not apply, so styles must be rewritten for the PDF components. A Chromium render uses them as they are.
Can react-pdf render my existing HTML?
Not directly. It does not parse HTML or your React DOM output, it renders its own primitives such as Document, Page, View and Text. To get a PDF of an existing HTML page, you print it with a browser engine or send it to a rendering API.
Why does my react-pdf invoice look different from the web page?
Because they are two separate layouts. The PDF is a different component tree with a smaller style subset and its own font and page break handling, so any change on one side must be repeated on the other. Rendering the web page itself removes the difference.
How much does a React PDF renderer alternative cost?
Self-hosted Chromium has no license fee but needs servers and maintenance time. SitePDF API plans start at $49 a month for 10,000 renders, or $99 a month for 50,000. See the pricing page for the current plans and yearly billing.

Index

More PDF and archiving tools

Get started

Render and archive with one API call

A pixel perfect PDF and a dated copy of the page from the same request. Plans from $49 a month, half price billed yearly.

HTML to PDF, in your browser

Buy the plan