Guides

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.

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).

3. Gotenberg

Gotenberg is a Docker container that wraps Chromium and LibreOffice behind an HTTP API.

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.

Migrating from wkhtmltopdf options

wkhtmltopdf flagPDFLoom / 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.


More guides