Best PDF Generation APIs, From Our Own Test Runs
Updated by Cyril Nicodème
Every test page that broke in our runs broke on Prince, the engine inside DocRaptor. So pick an API that runs Chromium, and the only question left is who runs the browser. With PDFShift, we do: you send one POST, and the PDF comes straight back. Between November 11 and 28, 2026, we sent the same test pages (a 75-row invoice, a page with a CSS grid and a script, a page that draws a Chart.js chart) to seven other APIs and engines, each next to PDFShift.
What came back when we sent our test pages to each API?
| API | Engine | Document we sent | What came back |
|---|---|---|---|
| PDFShift | Chromium | All of them | Grid, script and chart drawn; invoice in 3 pages with header and "Page N of M" footer |
| DocRaptor (Nov 11) | Prince 15.1 | Grid and script page | The 3-column grid stacked into one column. The script didn't run (JavaScript is off by default), and with javascript: true the request failed with a 422 on an arrow function |
| Prince 17 (Nov 18) | Prince 17 | Grid page, then a chart page | Grid, flexbox and print styles printed. On the chart page, fetch() and measuring a box didn't run and Chart.js didn't load, so the chart stayed blank |
| Gotenberg (Nov 14) | Chromium | Grid and script page | Grid and script printed like ours, on the public demo |
| PDFCrowd (Nov 15) | Not named | Invoice | Printed smaller than ours: its default margin and wider viewport shrink the page |
| Cloudflare Browser Run (Nov 16) | Chromium | 75-row invoice | 3 pages, 33 rows on page 1, same as ours |
| Browserless (Nov 23) | Chromium | 75-row invoice | 3 pages, 33 rows on page 1, 178,134 bytes against our 82,037 |
| PDF.co (Nov 28) | Not named | 75-row invoice | Same 3 pages and rows as ours |
Prince 17 isn't an API. It's the engine's newest version. DocRaptor still defaults to Prince 15.1, so we ran 17 ourselves. The newer Prince printed the grid, but not the chart.

PDFShift

Cloudflare Browser Run

Browserless

PDF.co
Which engine will render your HTML?
If you check your templates in Chrome, print them with Chromium. That's PDFShift, and it's also Gotenberg, Browserless and Cloudflare Browser Run.
Prince (DocRaptor). Prince is a print engine for documents meant to be printed, and it doesn't run JavaScript unless you turn it on. If your documents are HTML your app already shows in a browser, you'll be checking every template twice: once in Chrome, once in Prince.

PDFShift

Prince 17
An older Chrome (Api2Pdf). Api2Pdf runs Chrome 130 in production. Chrome added @page margin boxes, the CSS way to put headers and page numbers in your print stylesheet, in Chrome 131. On Api2Pdf you'd build those with its header and footer template options instead. It also still offers wkhtmltopdf, an engine whose GitHub project was archived in 2023.
Engine not named. PDFCrowd, PDF.co and Nutrient don't say what renders your HTML. Nutrient sells a document platform, and HTML to PDF is one of many operations in its DWS Processor API.
Do you want to run the browser yourself?
Running Chromium is the work: memory, crashes, fonts, updates and the server it sits on. We've run it for other people's PDFs since 2018, and the short version is this: people don't buy PDFs. They buy not having to run Chromium.
- Gotenberg ships as a Docker image you run. It's free software, so the bill is the server: about $47 a month for one always-on Google Cloud Run instance in Iowa with 1 vCPU and Gotenberg's 1 GiB memory minimum, after Google's free tier and before traffic and before the time someone spends patching it.
- Browserless hosts the browser, and you drive it. Its
/pdfendpoint takes Puppeteer'spage.pdf()options and uses Chrome's print engine, so you still tune Chrome's print options, just on someone else's machine. - Cloudflare Browser Run gives you a hosted browser you call from a Cloudflare Worker or its REST API. Workers Free includes 10 minutes of browser time a day.
- Puppeteer or Playwright on your own servers is the do-it-all-yourself version. Our Puppeteer alternative page covers what moving off it looks like.
With PDFShift there's nothing to host or patch. Chromium runs on our servers in France, and this is the whole call:
curl https://api.pdfshift.io/v3/convert/pdf \
-H 'X-API-Key: sk_your_api_key' \
-H 'Content-Type: application/json' \
-d '{"source": "https://example.com/invoice/1042", "use_print": true}' \
-o invoice-1042.pdf
Should your template live in your code or in a vendor's editor?
A second group of APIs has you build the template in their editor or in a Word or Google Docs file, then send JSON to fill it in.
- PDFMonkey templates are HTML and CSS with Liquid tags, kept in its app. Generation is asynchronous: you poll or take a webhook. Its free plan covers 20 documents a month. If you're leaving it, our PDFMonkey alternative page shows how a Liquid template moves into your own code.
- CraftMyPDF has a drag-and-drop editor and a REST API, with 50 PDFs a month and 3 templates on its free plan.
- APITemplate.io has a visual editor and an HTML editor. Its free plan covers 50 PDFs a month and 3 templates, and async generation with webhooks starts on its paid plans.
- PDF Generator API builds documents in its own template editor, with a 14-day trial. Its Creator plan is €80 a year.
- Carbone fills Word, Excel, PowerPoint or LibreOffice templates with JSON, with 100 documents a month free.
- DocsAutomator fills Google Docs and Word templates, from no-code tools or its API.
If your app already renders the document as HTML, these mean moving every template out of your code, and they're a different way of working, not a better engine for it. Stick with HTML and your templates stay in your repository, reviewed and versioned with the code that fills them. The API only has to print them.
What changes when you move a template to PDFShift?
Most of the work in switching APIs is in the defaults, not the code. Three of them can change the result without any error.
Print or screen CSS. DocRaptor and PDF.co print with your print stylesheet by default, and so does Chrome's page.pdf(), which Browserless and Puppeteer call. PDFShift renders with screen CSS unless you add "use_print": true. If your template has an @media print block, add that one parameter and the PDF matches what you had.
Paper size and margins. Gotenberg defaults to Letter, and PDFShift to A4. PDFCrowd adds a 0.4 in margin on every side by default. Set format and margin in your PDFShift request to the values you had, and the page breaks land where they did before.
Where the file goes. PDF.co answers with a link to a file it keeps for 60 minutes by default, and PDFMonkey with a download link valid for 1 hour. PDFShift returns the PDF itself and keeps nothing. If you want a link instead, filename stores it for 2 days, or s3_destination writes it to your own bucket.
Headers and page numbers port too. Our 75-row invoice used the header and footer parameters, with {{date}} and {{title}} in the header and "Page {{page}} of {{total}}" in the footer. If your current API builds headers from HTML snippets with page-number tokens, it's usually a rename of the token, not a redesign.
What else can the same request do?
Most of what people bolt onto a PDF pipeline after the render is a parameter on the same PDFShift call.
- One long page instead of A4 sheets. Set
formatto a width andauto, like"1024xauto", and the PDF is one page as tall as your content. Good for receipts, and for saving a web page as it looks on screen. - A password.
protectiontakes auser_passwordand anowner_password, andno_printstops the file being printed. - A watermark.
watermarktakes text or an image, with its size, color, opacity, position and rotation. - A webhook.
webhookposts the file's URL to your endpoint when it's ready, for batches you don't want to wait on. - Pages behind a login.
http_headersandcookiesgo with the request when you convert a URL, so a dashboard or an account page prints as the signed-in user sees it. - Images too. The same API returns PNG, JPEG or WebP from the same HTML or URL, and it can capture one area of the page, a single element picked by its CSS selector, or the whole page. That covers social cards, report thumbnails and the preview image next to a PDF download link.
How do these APIs bill a document?
The billing unit decides the bill more than the price list does. A PDFShift credit covers up to 5 MB of output, so a 3-page invoice or a 9-page one is 1 credit. On PDF.co our 3-page invoice cost 27 credits and a 9-page version 81. PDFCrowd charges 1 credit per 0.5 MB of output. CraftMyPDF counts 1 credit per PDF whatever its pages, and Carbone counts per 1 MB of data. Nutrient charges $37.50 per 1,000 HTML-to-PDF operations, after $5 of free usage a month. Api2Pdf bills $1 a month plus bandwidth and seconds of compute.
PDFShift's free plan is 50 credits a month with no card, and paid plans start at $9 for 500 credits. The PDF generator API page has our prices next to other APIs from 500 to 500,000 PDFs a month.
Which one should you try first?
PDFShift. Our users give us 4.8 stars from 65 reviews on Capterra, but the test that counts is your own template, so send us the hardest one you have: the grid, the chart, the 75-row table. Add "sandbox": true and you get a watermarked PDF that uses no credits, or sign up for the free plan and run it for real. Then open the PDF and check four things:
- Page breaks. Does a table row split across two pages, or a total end up alone at the top of the last one?
- Fonts. Is every web font there, or did a fallback font slip in?
- Scripts. Did the chart draw and the data load before the page printed?
- Headers and footers. Do they show on every page, with the right page numbers?
If an AI agent will be making the PDFs, read our list of PDF APIs an AI agent can call.
Spot a mistake, or want a tool we missed?
Drop us a line.