No deprecated Qt. No installation. Chromium rendering via REST API.
wkhtmltopdf is based on an outdated WebKit engine and is no longer maintained. Modern CSS (Flexbox, Grid, CSS variables) often renders incorrectly. HTML2DocHub uses a current Chromium build — the same engine as Google Chrome — for pixel-perfect rendering of any modern HTML.
# wkhtmltopdf: installation headaches, old rendering engine # Ubuntu: apt install wkhtmltopdf (outdated version) # macOS: brew install wkhtmltopdf (ARM issues) wkhtmltopdf \ --page-size A4 \ --margin-top 20mm \ --margin-bottom 20mm \ input.html output.pdf # Problems: # - Flexbox/Grid may not render correctly # - JavaScript execution is limited # - No longer actively maintained
# HTML2DocHub: REST API, current Chromium, works everywhere
curl -X POST https://api.html2dochub.com/v1/render \
-H "X-API-Key: sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "pdf",
"html": "'"$(cat input.html)"'",
"options": {
"format": "A4",
"margin_top": "20mm",
"margin_bottom": "20mm",
"print_background": true
}
}' | python3 -c "import json,sys; print(json.load(sys.stdin)['''download_url'''])"# Before (pdfkit / wkhtmltopdf)
import pdfkit
pdfkit.from_file("input.html", "output.pdf")
# Requires wkhtmltopdf binary, PATH config, etc.
# After (HTML2DocHub) — no binary dependencies
import requests
with open("input.html") as f:
html = f.read()
resp = requests.post(
"https://api.html2dochub.com/v1/render",
headers={"X-API-Key": "sk_live_YOUR_KEY"},
json={"type": "pdf", "html": html, "options": {"format": "A4"}},
)
pdf_url = resp.json()["download_url"]
# Download
import urllib.request
urllib.request.urlretrieve(pdf_url, "output.pdf")Pay only for pages rendered. No subscriptions. No minimum monthly fee.
Free account. No credit card required. API ready in minutes.
Get your free API key