wkhtmltopdf alternatives

Modern Chromium rendering for HTML-to-image and PDF.

TL;DR: wkhtmltopdf uses Qt WebKit, a browser engine effectively frozen at a mid-2010s state. CSS Grid, CSS custom properties, and many modern layout features are unsupported or broken. Switch to a Chromium-based tool for reliable rendering of modern HTML. Openkova is free, self-hosted, and MIT-licensed.

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

Modern alternatives

ToolEngineCSS GridCustom propsSelf-hostedCost
OpenkovaChromium (current)Free / MIT
PuppeteerChromium (current)Free
PlaywrightChromium / FirefoxFree
wkhtmltopdfQt WebKit (~2014)Free

Openkova vs wkhtmltopdf

FeaturewkhtmltopdfOpenkova
Rendering engineQt WebKit (~Safari 5-era)Chromium (current Chrome)
CSS Grid
CSS custom properties
FlexboxPartial
position: sticky
JavaScript executionLimited
REST API
SSE progress streaming
Docker support
HTML snippet modeVia file✓ direct string
LicenseLGPLMIT

Getting started with Openkova

git clone https://github.com/scnix-git/openkova
docker compose up

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