wkhtmltopdf alternatives
Modern Chromium rendering for HTML-to-image and PDF.
What wkhtmltopdf is
wkhtmltopdf is a command-line tool that converts HTML to PDF and images using Qt WebKit — a fork of the WebKit engine (the same engine that powers Safari) based on an older snapshot. Development of the underlying engine was effectively halted when Qt moved on from WebKit.
The last release, v0.12.6.1, was published in 2022 but contained no browser engine updates. For simple, pre-2015-era HTML with inline styles and table-based layouts, wkhtmltopdf still works. For anything using modern CSS, it breaks.
What wkhtmltopdf cannot render
- CSS custom properties (
--color: red; color: var(--color)) — not supported - CSS Grid (
display: grid) — not supported - position: sticky — not supported
- backdrop-filter — not supported
- Modern JavaScript — async/await and many ES6+ features are unreliable
- Modern font loading — web fonts from Google Fonts and similar CDNs load inconsistently
Modern alternatives
| Tool | Engine | CSS Grid | Custom props | Self-hosted | Cost |
|---|---|---|---|---|---|
| Openkova | Chromium (current) | ✓ | ✓ | ✓ | Free / MIT |
| Puppeteer | Chromium (current) | ✓ | ✓ | ✓ | Free |
| Playwright | Chromium / Firefox | ✓ | ✓ | ✓ | Free |
| wkhtmltopdf | Qt WebKit (~2014) | ✗ | ✗ | ✓ | Free |
Openkova vs wkhtmltopdf
| Feature | wkhtmltopdf | Openkova |
|---|---|---|
| Rendering engine | Qt WebKit (~Safari 5-era) | Chromium (current Chrome) |
| CSS Grid | ✗ | ✓ |
| CSS custom properties | ✗ | ✓ |
| Flexbox | Partial | ✓ |
| position: sticky | ✗ | ✓ |
| JavaScript execution | Limited | ✓ |
| REST API | ✗ | ✓ |
| SSE progress streaming | ✗ | ✓ |
| Docker support | ✓ | ✓ |
| HTML snippet mode | Via file | ✓ direct string |
| License | LGPL | MIT |
Getting started with Openkova
git clone https://github.com/scnix-git/openkova
docker compose upConvert an HTML template that uses modern CSS:
curl -N -X POST http://localhost:3000/api/convert/snippet \
-H "Content-Type: application/json" \
-d '{
"html": "<div style=\"display:grid;grid-template-columns:1fr 1fr;gap:16px\"><div style=\"background:var(--c,#7c6af7);color:white;padding:24px\">Card 1</div><div style=\"background:var(--c,#7c6af7);color:white;padding:24px\">Card 2</div></div>"
}'See the API reference for the full SSE streaming format, or compare with html2canvas alternatives and Urlbox alternatives.
Frequently asked questions
Is wkhtmltopdf still maintained?
Active browser engine development stopped around 2012–2014. The 2022 release was a packaging update with no engine changes. Most projects have migrated to Puppeteer, Playwright, or a Chromium-based service.
Does wkhtmltopdf support CSS Grid?
No. The Qt WebKit engine predates CSS Grid. Any HTML using display: grid, CSS custom properties, or position: sticky will not render correctly.
Can I migrate from wkhtmltopdf to Openkova?
Yes. Send your HTML template to POST /api/convert/snippet. Openkova renders it with headless Chromium. For PDF output, Puppeteer's page.pdf() and Playwright's page.pdf() both support it.
What is the best self-hosted replacement for wkhtmltopdf?
Openkova if you need an HTTP REST API (no language dependency). Puppeteer or Playwright if you prefer a Node.js library. Both use current Chromium with full modern CSS support.