wkhtmltopdf Alternative

Move on from wkhtmltopdf

wkhtmltopdf was the standard HTML-to-PDF tool for a decade. It's now abandoned, stuck on a CSS 2.1 engine, and breaks on modern Linux distributions. Here's what to use instead.

Why wkhtmltopdf fails on modern layouts

wkhtmltopdf uses a patched version of Qt WebKit — the browser engine Apple abandoned in 2012 in favour of Blink. Its CSS support is frozen at roughly the 2013 level: no flexbox, no CSS grid, no CSS custom properties, no @font-face from CDNs, no modern layout primitives at all. Any template using Tailwind v3+, Bootstrap 5, or any component library built in the last five years will produce broken or unrecognisable output.

The project's last release (0.12.6) was in June 2020, and the maintainers archived the GitHub repository in January 2023 — it's now read-only, with no new issues, pull requests, or releases possible. It also requires compiling Qt WebKit from source on newer Linux distributions, which frequently fails.

FeaturewkhtmltopdfRenderfy
CSS supportCSS 2.1 + limited CSS 3Full CSS (Chromium)
Flexbox / GridNot supportedFully supported
CSS variablesNot supportedFully supported
Custom fontsSystem fonts only / fragileWebfonts + system fonts
Active maintenanceAbandoned (last release 2020)Yes
Tailwind CSSPartial / brokenFull support
Serverless friendlyRequires binary on hostYes — plain HTTP
Multi-page supportYesYes (natural browser page breaks)
Output formatsPDF, PNG, SVGPDF, PNG, JPEG, WebP
Custom brand fontsSystem fonts only / fragileGoogle Fonts by family name — per request
Saved templatesNoYes — POST { template, data } with placeholder substitution
Batch renderingNo (one call per doc)Up to 20 per request
Data residencyWherever you hostEU — server in Germany, DB in Ireland
Input typesHTML / URLHTML, Tailwind, Markdown, code, charts, diagrams, math

Migrating from wkhtmltopdf

If you have existing HTML templates designed for wkhtmltopdf, they'll almost certainly render better with a Chromium-based engine — the CSS support gap was in wkhtmltopdf's favour in zero cases. The migration path is straightforward:

  1. Replace your wkhtmltopdf call with an HTTP POST to the Renderfy render endpoint.
  2. Pass your existing HTML as the content field with type: "html".
  3. Optionally modernise the template to use Tailwind — it'll render correctly now that you have a real CSS engine.

Side-by-side: generating a PDF

wkhtmltopdf

import { exec } from 'child_process';

exec(
  `wkhtmltopdf - output.pdf`,
  (err) => { ... }
);
// Requires binary on host
// No flexbox, no grid
// Abandoned since 2020

Renderfy

const res = await fetch(
  'https://renderfy.io/api/v1/render',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer KEY',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      type: 'html',
      content: yourHtml,
      options: { format: 'pdf',
                 dimensions: 'a4' },
    }),
  }
);
// Full CSS, no binary, serverless

Full CSS support, no binary to manage

100 free credits. First render in under 5 minutes.

Get started free