wkhtmltopdf alternatives in 2026: what to use now that it is archived
For years, wkhtmltopdf was the default way to turn HTML into PDF. Its GitHub repository was archived in January 2023, and it's built on a QtWebKit engine whose rendering is roughly a decade behind current browsers. Flexbox is partial, CSS grid doesn't work, and modern JavaScript often fails. It also gets no security fixes, which matters if you render anything users can influence.
If you're starting a project or migrating an old one, here are the realistic replacements.
1. Headless Chrome (Puppeteer or Playwright)
This is the closest thing to a standard now. Chrome's print engine supports modern CSS, web fonts and JavaScript, and output matches what you see in the browser's print preview.
- Pros: best rendering fidelity, actively maintained, free.
- Cons: heavy (hundreds of MB of RAM per browser), and you have to manage processes, fonts and security yourself. See our Node.js guide for the pitfalls.
2. WeasyPrint (Python)
WeasyPrint is a pure-Python layout engine built specifically for print. It has excellent support for paged-media CSS (@page, running headers, footnotes).
- Pros: light, no browser, great print CSS.
- Cons: no JavaScript, so client-rendered charts won't appear, and its CSS support differs from browsers.
3. Gotenberg
Gotenberg is a Docker container that wraps Chromium and LibreOffice behind an HTTP API.
- Pros: self-hosted, language-agnostic, also converts Office documents.
- Cons: you still run, scale and patch the container, and you need memory headroom for Chromium.
4. A hosted HTML to PDF API
Services like PDFLoom run headless Chrome for you. You send HTML or a URL and get a PDF back.
- Pros: nothing to install, modern rendering, works from any language, including serverless.
- Cons: costs money at volume, and your HTML is sent to a third party. PDFLoom doesn't store documents.
Migrating from wkhtmltopdf options
| wkhtmltopdf flag | PDFLoom / Puppeteer option |
|---|---|
--page-size A4 | "format": "A4" |
--orientation Landscape | "landscape": true |
--margin-top 20mm | "margin": {"top": "20mm"} |
--header-html / --footer-html | "displayHeaderFooter": true + headerTemplate / footerTemplate |
[page] / [topage] | <span class="pageNumber"> / <span class="totalPages"> |
--zoom 0.8 | "scale": 0.8 |
--no-background | "printBackground": false |
--javascript-delay | "waitUntil": "networkidle0" |
Expect some layout differences when you switch: Chrome follows modern CSS, so hacks you added for old WebKit (like display: -webkit-box) can usually be deleted.
Try it
curl https://pdfloom.dev/v1/pdf \
-H "Authorization: Bearer $PDFLOOM_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "format": "A4"}' -o out.pdf
Get a free API key (100 PDFs a month), or try the online converter first.