wkhtmltopdf was deprecated in 2022

The Best wkhtmltopdf Alternative
for Modern Apps

wkhtmltopdf is unmaintained and can't render modern CSS or JavaScript. SnapAPI uses real Chromium — the same engine as Chrome — to generate pixel-perfect PDFs from any URL or HTML string.

Start Free — 200 PDFs/mo View Docs →

Why wkhtmltopdf is Failing Your App

The project was officially abandoned in 2022. It runs an outdated Qt WebKit engine that predates Chrome's Blink — meaning CSS Grid, Flexbox, modern fonts, and JavaScript-rendered content all break.

🚫

No Modern CSS

CSS Grid, Flexbox, CSS variables, and modern animations don't work. Your PDFs look like they're from 2010.

No JavaScript Rendering

React, Vue, Angular — none of it renders. wkhtmltopdf can't wait for JS to execute, so dynamic content shows as blank.

🔒

Security Vulnerabilities

Unmaintained since 2022 means no CVE patches. Running it in production exposes you to known SSRF and local file inclusion vulnerabilities.

🖥️

Binary Dependency Hell

Different behavior on Ubuntu 20 vs 22, Alpine, Debian. Docker images balloon to 500MB+. CI/CD breaks constantly on new OS versions.

🔡

Font and Encoding Issues

Unicode, CJK characters, and Google Fonts regularly fail. You spend hours on font path config that should be automatic.

📊

No Page Break Control

Tables splitting mid-row, images cut in half — wkhtmltopdf's CSS page-break support is broken and has been for years.

wkhtmltopdf vs SnapAPI: Full Comparison

Feature wkhtmltopdf SnapAPI
Rendering engine Qt WebKit (abandoned) Real Chromium (latest)
CSS Grid / Flexbox ❌ Broken ✅ Full support
JavaScript rendering ❌ Not supported ✅ Full JS execution
React / Vue / Angular output ❌ Blank pages ✅ Fully rendered
Security patches ❌ Abandoned 2022 ✅ Managed & updated
Google Fonts support ❌ Manual config ✅ Automatic
Server dependency 500MB+ binary Zero — REST API call
Price Free (but VPS costs $20-80/mo) Free tier → $19/mo
Setup time Hours (Docker, fonts, paths) 5 minutes (API key)
Maintenance Yours forever Zero — we handle it

Migration Takes Under 30 Minutes

Replace your wkhtmltopdf integration with 3 lines of code. Same output — better rendering, zero maintenance.

Python (before → after)

# BEFORE — wkhtmltopdf
import subprocess
result = subprocess.run(
    ['wkhtmltopdf', '--javascript-delay', '2000', 'https://example.com', 'output.pdf'],
    capture_output=True
)

# AFTER — SnapAPI (drop-in replacement)
import requests
response = requests.post('https://api.snapapi.pics/v1/pdf',
    headers={'X-API-Key': 'YOUR_API_KEY'},
    json={'url': 'https://example.com', 'format': 'A4', 'print_background': True}
)
with open('output.pdf', 'wb') as f:
    f.write(response.content)  # Done. Modern CSS, JS rendered, Google Fonts work.

Node.js (before → after)

// BEFORE — wkhtmltopdf
const { execSync } = require('child_process');
execSync('wkhtmltopdf --disable-smart-shrinking https://example.com output.pdf');

// AFTER — SnapAPI
const response = await fetch('https://api.snapapi.pics/v1/pdf', {
  method: 'POST',
  headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
  body: JSON.stringify({ url: 'https://example.com', format: 'A4', print_background: true })
});
const buffer = await response.arrayBuffer();
require('fs').writeFileSync('output.pdf', Buffer.from(buffer));

PHP (before → after)

// BEFORE — wkhtmltopdf via PHP
exec('wkhtmltopdf https://example.com /tmp/output.pdf');
$pdf = file_get_contents('/tmp/output.pdf');

// AFTER — SnapAPI
$ch = curl_init('https://api.snapapi.pics/v1/pdf');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode(['url' => 'https://example.com', 'format' => 'A4'])
]);
$pdf = curl_exec($ch);

PDF from raw HTML string

# Generate PDF directly from an HTML string — no URL needed
import requests, base64

html_content = (
    "<!DOCTYPE html>"
    "<html><head><style>"
    "body { font-family: Inter, sans-serif; padding: 40px; }"
    ".invoice-header { font-size: 24px; font-weight: bold; }"
    "table { width: 100%; border-collapse: collapse; margin-top: 20px; }"
    "td, th { padding: 12px; border: 1px solid #e5e7eb; }"
    "</style></head>"
    "<body><div class='invoice-header'>Invoice #1234</div></body></html>"
)

response = requests.post('https://api.snapapi.pics/v1/pdf',
    headers={'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json'},
    json={'html': html_content, 'format': 'A4', 'print_background': True}
)
with open('invoice.pdf', 'wb') as f:
    f.write(response.content)

Common Use Cases

📄 Invoice & Receipt PDFs

Pass an HTML template with CSS styling. SnapAPI renders it with real Chrome — tables, grids, custom fonts all work perfectly.

📊 Reports & Dashboards

Screenshot a React/Vue dashboard page as a PDF for email delivery or archival. JavaScript charts render fully.

📝 Proposals & Contracts

Convert proposal builder output (HTML) to PDF for e-signature tools. Modern CSS layouts preserved exactly.

📚 Documentation Exports

Print Notion pages, Markdown docs, or wiki content as PDFs with correct syntax highlighting and layout.

Pricing

Free
200 PDFs/month
$0
No credit card required
Starter
5,000 PDFs/month
$19/mo
vs. $20-40/mo VPS for wkhtmltopdf
Growth
50,000 PDFs/month
$79/mo
vs. $80-200/mo self-hosted at scale

FAQ

Can I pass raw HTML instead of a URL?

Yes. POST a html parameter alongside your API key. SnapAPI renders the HTML string exactly as Chrome would display it.

Does it support custom page sizes?

Yes — A4, Letter, Legal, or any custom width/height in pixels. Set format or width/height in the request.

What about CSS @media print?

Fully supported. SnapAPI passes emulateMediaType: "print" to Chromium by default, so print-specific styles apply correctly.

How do I handle authentication on my pages?

Pass cookies or a Bearer token in the headers param. Or use our html parameter to pass already-rendered HTML directly.

Is the old wkhtmltopdf still secure to use?

No. The project has been unmaintained since 2022. There are known SSRF and local file inclusion vulnerabilities with no patches available. Migrate as soon as possible.

Migrate from wkhtmltopdf in 30 Minutes

Start for free — 200 PDFs/month, no credit card required. Modern CSS, JS rendering, zero maintenance.

Start Free Read the Docs →

Real Cost: wkhtmltopdf vs SnapAPI

Cost Item wkhtmltopdf SnapAPI
License cost Free Free tier / $19+
VPS / server cost $20-80/mo $0 (included)
Initial setup dev time 4-16 hours 30 min
Monthly maintenance 2-4 hrs/mo 0 hrs
CSS Grid, Google Fonts, JS rendering Broken / unsupported Full support

Advanced PDF Options

import requests

response = requests.post(
    "https://api.snapapi.pics/v1/pdf",
    headers={"X-API-Key": "YOUR_KEY"},
    json={
        "url": "https://yourapp.com/invoice/123",
        "format": "A4",
        "print_background": True,
        "prefer_css_page_size": True,
        "margin": {"top": "20mm", "right": "15mm", "bottom": "20mm", "left": "15mm"},
        "delay": 2000
    }
)
with open("invoice.pdf", "wb") as f:
    f.write(response.content)

What Renders Correctly (Unlike wkhtmltopdf)

CSS Grid and Flexbox

Modern invoice layouts, multi-column tables, responsive report templates — all render correctly.

Google Fonts

Inter, Roboto, Montserrat load automatically. No font path config. No binary font installation.

React / Vue Pages

JavaScript executes fully before PDF capture. Dynamic dashboards and SPA invoice routes render perfectly.

Unicode and CJK

Japanese, Chinese, Korean, Arabic scripts all render natively through Chromium without manual font setup.

Can I pass raw HTML to generate PDFs without a URL?

Yes. POST a html parameter with your HTML string. SnapAPI renders it in Chromium exactly as a browser would, then returns the PDF binary.

Does it support print media CSS rules?

Yes. Chromium respects @media print, page-break-before, page-break-inside: avoid, orphans, and widows — all the CSS print rules that wkhtmltopdf mishandles.

Migrate from wkhtmltopdf in 30 Minutes

200 free PDFs to start. Real Chromium rendering. Zero server maintenance. No credit card required.

Start Free Read Docs

The Hidden Costs of Running wkhtmltopdf in Production

Most developers underestimate how much time wkhtmltopdf actually consumes. Beyond the initial setup, there are recurring costs that compound over time:

Docker Image Size and Build Time

wkhtmltopdf requires system dependencies that inflate Docker images by 200-400MB. On every CI/CD run, this adds 2-4 minutes to build time. Over a year of daily deploys, this adds up to 12-24 hours of wasted CI/CD minutes — at $0.008 per GitHub Actions minute, that is $58-117 in CI costs alone.

Font Configuration Debugging

Unicode, Google Fonts, and system font fallbacks behave differently across Ubuntu 20.04, 22.04, Alpine, and Debian. Every OS upgrade triggers a new round of font debugging. Developers report spending 4-8 hours debugging font issues across their careers with wkhtmltopdf — time that would have cost $400-800 at standard developer rates.

CSS Incompatibility Bug Reports

When a designer updates an invoice template with CSS Grid or a new Google Font, wkhtmltopdf renders it incorrectly. Someone files a bug. A developer investigates for 2 hours, discovers it is a wkhtmltopdf limitation, and spends another 2 hours writing a CSS workaround that makes the template worse on screen. This cycle repeats every time the design changes.

Security Incident Risk

wkhtmltopdf has known SSRF (Server-Side Request Forgery) vulnerabilities. If your app lets users supply a URL that gets rendered to PDF, an attacker can potentially use wkhtmltopdf to make internal network requests. With no security patches since 2022, this vulnerability will never be fixed. Migrating to a hosted API moves this risk entirely off your infrastructure.

When you add up VPS costs, developer time, CI/CD costs, and security risk, wkhtmltopdf is not free. SnapAPI at $19/mo is a bargain compared to the true total cost of self-hosting an unmaintained binary.