What an HTML to PDF API is, and the four hosted ones compared here
An HTML to PDF API accepts HTML, or a URL, in an HTTP request and returns a rendered PDF, so you do not run a browser or a rendering engine on your own servers. The four hosted services below all work that way. They differ in the engine behind them, in how they count usage and in price.
There is also a free route: run headless Chrome yourself. It costs nothing in license fees and is a fair choice for many teams, so it gets its own section.
DocRaptor, PDFShift, Api2Pdf and Doppio: calls and prices
Endpoints and parameters come from each vendor's documentation, and prices from each pricing page, all read on 3 October 2026. Prices are monthly billing in US dollars.
| API | Rendering engine | Documented call | Free tier | Entry price |
|---|---|---|---|---|
| DocRaptor | Prince | POST to https://api.docraptor.com/docs with type and document_content or document_url | 5 documents a month; "test": true gives free watermarked documents | Basic: $15 a month, 125 documents |
| PDFShift | Chromium | POST to https://api.pdfshift.io/v3/convert/pdf with source, key in the X-API-Key header | 50 credits a month; sandbox gives free watermarked output | Not readable in the page source |
| Api2Pdf | Headless Chrome or wkhtmltopdf | POST to https://v2.api2pdf.com/chrome/pdf/html with html, key in the Authorization header | None stated on the pricing page | $1 a month plus $0.001 per MB and $0.00019551 per second |
| Doppio | Not stated on the pricing page | See Doppio's render documentation | 400 documents a month | Premium: $16 a month, 4,000 documents |
Counting rules matter as much as the headline price. DocRaptor charges the same for any document size. PDFShift counts one credit per 5 MB of output. Api2Pdf bills bandwidth and compute time. PDFShift's documentation also says requests without a valid key are treated as a free account: watermarked, capped at 2 MB and 10 conversions a day.
The open source route: Puppeteer, Gotenberg and why not wkhtmltopdf
If you can run Chrome, you do not need to pay for conversion.
- Puppeteer (Node.js). Install with
npm i puppeteer, which also downloads a Chrome for Testing build of roughly 170 to 282 MB depending on the platform. Load your markup withawait page.setContent(html)and write the file withawait page.pdf({ path: 'out.pdf' }). - Gotenberg (any language). Start the container with
docker run --rm -p "3000:3000" gotenberg/gotenberg:8, then POST a file namedindex.htmlto/forms/chromium/convert/html. You get an HTTP API that you host. - wkhtmltopdf. Still widely installed, but its own status page says the WebKit it uses has not been updated since 2012 and warns against feeding it untrusted HTML. That page points report builders to WeasyPrint and pages with dynamic JavaScript to Puppeteer.
The step-by-step guide to generating a PDF from HTML code walks through the Puppeteer calls in order.
When a hosted API beats running Chrome yourself
Self-hosting is free until it is not. Browsers are heavy processes, each render holds memory, and someone has to patch the browser and size the queue. A hosted API is worth paying for when PDF volume is bursty, when your platform cannot run a browser at all, or when you need print features a browser handles poorly. DocRaptor's own case for its Prince engine is exactly that: complex layouts, tables of contents, and headers or page sizes that vary within one document.
If you already run containers and produce a few hundred simple documents a month, Gotenberg or Puppeteer is enough and you should not buy anything. Whatever you choose, test long tables early, because a table that splits across pages needs explicit CSS; see the page breaks guide.
When a template API is the better fit than HTML to PDF
HTML to PDF assumes a developer owns the layout. Every wording change, logo swap or extra column is a code change and a deploy. A template API moves the layout into an editor and leaves your code sending JSON only.
CraftMyPDF is the example this site covers most closely. Its editor is drag and drop and needs no HTML or CSS, and its Free plan allows 50 PDFs a month with 3 templates. APITemplate.io sits in between, with both a visual editor and an HTML editor. Choose that family when a non-developer must be able to change the document. Stay with HTML to PDF when your HTML already exists and changes rarely. The PDF generation API comparison lists both families side by side, and CraftMyPDF vs DocRaptor compares one of each directly.
Sources used for this page
The facts above come from the pages below, read on 3 October 2026. We have not used these products hands-on. Prices and terms change, so confirm them on the vendor's site before you buy.
- Signup for DocRaptor (plans and pricing) — Vendor pricing page · docraptor.com · checked 2026-10-03
- DocRaptor API documentation: overview and parameters — Vendor documentation · docraptor.com · checked 2026-10-03
- DocRaptor: HTML to PDF API (home page) — Vendor product page · docraptor.com · checked 2026-10-03
- Pricing Plans | PDFShift — Vendor pricing page · pdfshift.io · checked 2026-10-03
- Convert to PDF - PDFShift API Documentation — Vendor documentation · docs.pdfshift.io · checked 2026-10-03
- Authentication - PDFShift API Documentation — Vendor documentation · docs.pdfshift.io · checked 2026-10-03
- Pricing | API2PDF — Vendor pricing page · api2pdf.com · checked 2026-10-03
- API2PDF home page with starter requests — Vendor product page · api2pdf.com · checked 2026-10-03
- Pricing | Doppio — Vendor pricing page · doppio.sh · checked 2026-10-03
- Installation | Puppeteer — Vendor documentation · pptr.dev · checked 2026-10-03
- Page.setContent() method | Puppeteer — Vendor documentation · pptr.dev · checked 2026-10-03
- Page.pdf() method | Puppeteer — Vendor documentation · pptr.dev · checked 2026-10-03
- Installation | Gotenberg — Vendor documentation · gotenberg.dev · checked 2026-10-03
- Convert HTML to PDF | Gotenberg — Vendor documentation · gotenberg.dev · checked 2026-10-03
- wkhtmltopdf project status — Vendor documentation · wkhtmltopdf.org · checked 2026-10-03
- Pricing - CraftMyPDF.com — Vendor pricing page · craftmypdf.com · checked 2026-10-03
- Generate PDF with Zapier - CraftMyPDF — Vendor product page · craftmypdf.com · checked 2026-10-03
- Pricing - APITemplate.io — Vendor pricing page · apitemplate.io · checked 2026-10-03