Skip to content

jsPDF alternative

jsPDF Alternative for Teams Whose Client-Side PDFs Come Out Blurry, Heavy or Wrong

jsPDF is a fine library for a small receipt generated in the browser. It stops being fine when the document is an invoice, a statement or a report that the customer keeps, because html2canvas turns the page into pictures, text cannot be selected, files balloon and every user's browser produces slightly different output. A jsPDF alternative moves the rendering to the server, where one Chromium produces the same selectable PDF every time.

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

Short answer

The best jsPDF alternative for documents that matter is a server-side renderer that prints HTML through Chromium. The html() method in jsPDF relies on html2canvas, which paints the page onto a canvas, so text is typically embedded as an image, files grow large and output varies by browser and device. A rendering API such as SitePDF takes the same HTML, returns a selectable-text PDF, and stores a dated copy of every render. Plans start at $49 a month for 10,000 renders.

Written and fact checked by the SitePDF team.

jsPDF and its alternatives, compared on what decides the choice

jsPDF, pdf-lib and Puppeteer are open source. The SitePDF figures come from our pricing page. The row that usually decides it is what you get when the template has a table, a web font and a logo.

jsPDF (client side) Self-hosted Puppeteer or Playwright SitePDF API
Where it runs The user's browser Your server, with a Chromium you maintain Managed Chromium, one HTTP call
Text in the PDF Drawn with text() is real text. Rendered with html() it is usually an image Selectable text Selectable text, searchable and copyable
File size for a 3 page invoice Grows quickly when pages are rasterized Small, fonts are embedded as subsets Small, same as Chrome print
Same output on every device No, depends on browser, fonts and zoom Yes Yes
CSS coverage Limited, a subset that html2canvas understands Full, it is Chrome Full, it is Chrome
Page breaks and repeating table headers Manual, you compute the positions Native CSS Native CSS
Works from a backend job, email or webhook No, needs an open browser tab Yes Yes
Cost Free Free plus server and engineering time From $49/mo ($288 billed yearly) for 10,000 renders, $99/mo for 50,000
Dated archive of every render No No Yes. archive=true, 90 days to 7 years by tier

jsPDF is the better tool for a small, mostly drawn document where you control every coordinate, such as a ticket or a label, and where nothing needs to be produced without a user present.

When jsPDF is still the right tool

jsPDF is MIT licensed, small, and runs with no server at all. If you draw a ticket, a certificate or a one page receipt with text() and addImage(), you get real vector text and a tiny file, and a backend would be extra moving parts. It is also the right call when the data must never leave the device. The jsPDF project documents both the drawing API and the html() plugin.

Where client-side PDFs break for paying customers

Rasterized text. The html() plugin hands the work to html2canvas, which reads the DOM and paints an approximation onto a canvas. The result is closer to a screenshot than a document. Customers cannot copy an invoice number, accounting tools cannot read the text, and screen readers get nothing.

Different output per device. The same invoice rendered on a laptop, a phone and an old browser differs in font fallback, line breaks and page cuts. Support then asks the customer which browser they used.

Page breaks you calculate yourself. A table that crosses a page needs a repeated header and no split rows. With CSS print rules in Chromium that is two lines. In jsPDF it is height arithmetic that breaks the day someone adds a line item. We cover the CSS side in HTML to PDF page breaks and the related blank page bug in html2pdf.js blank pages.

Nothing without a tab. A PDF generated in the browser cannot be attached to the email sent after checkout, cannot be built by a nightly job and leaves you no copy if the customer disputes the amount.

What moving to a rendering API looks like

You keep the HTML and CSS you already wrote for the on-screen version. Instead of passing the element to doc.html(), your backend posts the HTML, or the URL of the page, and receives a PDF link back. The frontend button calls your own endpoint, so the API key stays on the server. Teams usually finish the swap for one document type in an afternoon, then delete the coordinate code. A Node example is on the HTML to PDF Node.js page, and if the source is a React or Vue component the React to PDF and Vue to PDF pages show the render step.

A worked example with numbers

Take a small SaaS that issues 6,000 invoice PDFs a month, about 200 a day. Generated with jsPDF and html2canvas at, say, 300 KB per rasterized page, that is a large attachment for a three page invoice and no text for the customer's accountant to import. Rendered server side, the same invoice is a text PDF in the tens of kilobytes, because fonts are embedded as subsets and nothing is rasterized. 6,000 renders fit inside the Starter plan at $49 a month, or about $24 a month on yearly billing. A lost invoice dispute handled by a support engineer for an hour costs more than that, and the dated archive means the exact PDF the customer received is on file.

If those PDFs are also shown on office or lobby screens, a signage tool such as Displayer can pick up the finished files, which is one more reason to want a clean text PDF instead of a screenshot.

Which alternative for which case

Drawn documents with fixed coordinates and no server: stay with jsPDF, or look at pdf-lib. HTML templates that must match the screen and carry real text: use Chromium. Chromium can be self-hosted, and we price that honestly in what Playwright costs in production, or it can be called as an API. If you are comparing hosted options, the best HTML to PDF API roundup lists them with prices.

Your backend endpoint: send the invoice HTML, get a selectable-text PDF and a dated archived copy.
// Express route behind your own Download invoice button
app.post('/invoices/:id/pdf', async (req, res) => {
  const html = renderInvoiceHtml(await loadInvoice(req.params.id));
  const r = await fetch('https://api.sitepdf.com/v1/render', {
    method: 'POST',
    headers: { Authorization: `Bearer ${process.env.SITEPDF_KEY}` },
    body: new URLSearchParams({ html, format: 'A4', archive: 'true' }),
  });
  res.json(await r.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 jsPDF?
It depends on the document. For small drawn files, pdf-lib is a close client-side alternative. For HTML invoices, statements and reports that need selectable text and identical output everywhere, a Chromium based renderer is the better fit, either self-hosted with Puppeteer or Playwright or called as an API.
Is jsPDF text selectable?
Text drawn with the text() method is real, selectable text. Content converted through the html() method uses html2canvas, which paints the page onto a canvas, so the text is typically embedded as an image and cannot be selected or searched.
Why is my jsPDF file so large?
Pages rendered through html2canvas are stored as images, and each page can be hundreds of kilobytes. Text based PDFs from a Chromium renderer embed font subsets instead, so a multi page invoice usually stays small.
Can jsPDF generate PDFs on the server?
It can run in Node, but the html() plugin needs a DOM and canvas, so server use means adding a headless browser anyway. At that point printing through Chromium directly is simpler and gives vector text.
How much does a jsPDF alternative cost?
pdf-lib and self-hosted Chromium are free to license but cost server time and maintenance. SitePDF API plans start at $49 a month for 10,000 renders, or $288 billed yearly, and $99 a month for 50,000 renders.
Can I keep a copy of every generated PDF?
Yes. Client-side libraries leave no record on your side. With SitePDF you set archive=true on a render and a dated copy is stored for 90 days up to 7 years depending on the plan.

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