Alternatives
wkhtmltopdf alternatives
wkhtmltopdf is no longer maintained and uses a WebKit build from 2012. If your PDF layouts are broken, here's why — and what to use instead.
Why wkhtmltopdf breaks modern layouts
Unmaintained since 2020
The last release was 0.12.6 in June 2020. No Flexbox, no CSS Grid, no CSS variables, no modern selectors. The project is effectively abandoned.
Ancient WebKit engine
wkhtmltopdf embeds a patched WebKit from ~2012. Chrome has shipped hundreds of layout engine improvements since then. Your modern HTML will render incorrectly.
System binary in every environment
You must install the wkhtmltopdf binary on every developer machine, CI runner, and production server. Version mismatches between environments cause inconsistent output.
Font and image issues
Custom fonts, web fonts, SVG images, and base64-encoded assets all have known rendering bugs that will never be fixed.
Broken on modern Linux
wkhtmltopdf has missing Qt and X11 dependencies on current Ubuntu/Debian releases. Getting it running often requires Docker workarounds.
No Flexbox or Grid
If your HTML uses display: flex or display: grid — the majority of modern CSS layouts — wkhtmltopdf will render them incorrectly or not at all.
The best alternatives
Managed Chromium API. Full CSS support, built-in templates, under 1 second response. No binary to install — one HTTP request replaces your wkhtmltopdf call. Free tier is 100 documents/month with no credit card required.
- ✓ Full Flexbox, Grid, custom fonts, modern CSS
- ✓ No system dependencies — works in Docker, Lambda, serverless
- ✓ Built-in invoice, receipt, and report templates
- ✓ Under 1 second average response time
- ✓ Simple REST API — works in any language
Headless Chromium you control. Full CSS support — but you own the infrastructure. Each concurrent request needs its own Chrome instance (~200MB RAM). You need to build a browser pool or queue to handle load. 300MB+ added to your Docker image. Good if you have strict data residency requirements.
Managed API using the PrinceXML engine (not Chromium). Excellent for print-specific features like running headers and PDF/A compliance. Significantly more expensive — ~$75/month for 1,000 documents. Better than wkhtmltopdf but a different rendering model than a browser.
Microsoft's alternative to Puppeteer. Also uses Chromium (or Firefox/WebKit), same infrastructure tradeoffs as Puppeteer. More modern API, actively maintained. Same resource consumption concerns at scale.
Migrating from wkhtmltopdf to Papyr
The migration is usually a one-line change. Instead of shelling out to the binary, you make an HTTP request with your HTML.
# Before (wkhtmltopdf — system binary, broken CSS)
system("wkhtmltopdf --margin-top 20 input.html output.pdf")
# After (Papyr API — one HTTP call, full CSS support)
curl -X POST https://api.getpapyr.dev/v1/render/pdf \
-H "Authorization: Bearer pk_live_..." \
-H "Content-Type: application/json" \
-d '{"html": "<h1>Hello</h1>", "options": {"format": "A4"}}'Language-specific migration guides
Replace wkhtmltopdf today
100 free documents per month. No system binary. No credit card required.
Get started free