wkhtmltopdf was the go-to tool for HTML-to-PDF conversion for over a decade. It used Qt WebKit to render HTML faithfully, and for most use cases it worked well. But in 2023 the project was officially archived — no more updates, no more security fixes.
If you're still running wkhtmltopdf, you're running an unmaintained binary with a frozen browser engine. Here's what you can use instead, and why a hosted API is the most practical migration path for most teams.
Problems with Running wkhtmltopdf Today
The issues go beyond "no more updates." wkhtmltopdf requires a system binary on every server where PDF generation runs. On Docker-based deployments this means adding the binary and its dependencies to your image, which adds hundreds of megabytes and complicates your security posture.
On serverless platforms (Lambda, Cloud Run, Vercel) there is no straightforward way to run wkhtmltopdf at all. The binary has no ARM64 build for modern Apple Silicon or AWS Graviton servers. And its WebKit engine is frozen at a version that predates CSS Grid, modern flexbox, and many font features.
Alternatives Compared
Puppeteer / Playwright spin up a headless Chromium or Firefox process. You get a modern browser engine with full CSS support. The downside: managing a headless browser in production is operationally heavy — it's memory hungry, prone to crashes, and difficult to scale.
DomPDF and mPDF are pure-PHP options. No binary required, but they implement their own CSS renderer which is years behind modern standards. Complex layouts break.
Hosted REST APIs offload both the rendering and the infrastructure. You send HTML, you receive PDF. No binary, no process management, no scaling concerns on your side.
Migrating from wkhtmltopdf to a REST API
If you were calling wkhtmltopdf via shell_exec or a wrapper like barryvdh/laravel-snappy, migrating to a REST API is a two-step change: replace the shell call with an HTTP request, and remove the binary from your deployment.
// Before
$pdf = \Snappy::loadHTML($html)->output();
// After — HTML to PDF API
$client = new \HtmlToPdfApi\Client(env('HTMLTOPDF_API_KEY'));
$pdf = $client->fromHtml($html)->generate();What You Gain
Switching to a hosted API removes the binary from your servers entirely. Your Docker images get smaller, your deployment gets simpler, and PDF rendering keeps up with modern CSS automatically — because the rendering engine is updated on the API side, not yours.
The free tier covers 100 conversions per month, so you can validate the migration without any cost.