Comparing PDFShift, DocRaptor, wkhtmltopdf, Playwright, and SnapAPI across rendering quality, pricing, modern CSS support, and ease of integration.
Try SnapAPI Free View Docs →CSS Grid, Flexbox, Google Fonts, JavaScript-rendered charts, Unicode — modern web UIs use all of these. PDF generators built on outdated engines break on every one. The only reliable approach in 2026 is Chromium-based rendering.
Chromium-based PDF generation via REST API. Supports URL-to-PDF and HTML-string-to-PDF. Full CSS Grid, Flexbox, Google Fonts, JavaScript rendering. Also includes screenshot, scraping, and text extraction under the same API key.
Chromium-based PDF API focused purely on HTML-to-PDF conversion. Strong track record, good documentation. No screenshot or scraping capabilities. Priced competitively at scale.
Uses Prince XML engine rather than Chromium. Excellent CSS Paged Media support (running headers, footnotes, cross-references). More expensive but unmatched for document-heavy publishing workflows.
Run Chromium on your own infrastructure with full control over the browser. Excellent quality, no API costs, but requires DevOps setup, Docker management, and ongoing maintenance. Worth it above ~100K PDFs/month where API costs exceed VPS costs.
Officially abandoned in 2022. Uses outdated Qt WebKit — no CSS Grid, no Flexbox, no JavaScript rendering, known security vulnerabilities with no patches. Still widely referenced in old tutorials but should not be used in new projects.
| Feature | SnapAPI | PDFShift | DocRaptor | Playwright | wkhtmltopdf |
|---|---|---|---|---|---|
| CSS Grid / Flexbox | ✅ | ✅ | Partial | ✅ | ❌ |
| JavaScript rendering | ✅ | ✅ | ❌ | ✅ | ❌ |
| Google Fonts | Auto | Auto | Manual | Auto | Manual config |
| HTML string input | ✅ | ✅ | ✅ | ✅ | ✅ |
| Also: Screenshot API | ✅ | ❌ | ❌ | ✅ | ❌ |
| Free tier | 200/mo | Trial only | Trial only | OSS | OSS |
| Price at 5K PDFs/mo | $19/mo | $25/mo | $15/mo | VPS $20+/mo | VPS $20+/mo |
The right choice depends on your specific situation:
SnapAPI, PDFShift, and self-hosted Playwright all use Chromium and have equivalent, excellent CSS support. DocRaptor (Prince) has unmatched CSS Paged Media but less support for modern CSS layout properties. wkhtmltopdf has poor CSS support and should not be used.
Yes, with any Chromium-based API (SnapAPI, PDFShift, Playwright). JavaScript executes fully before PDF capture, so React/Vue pages render correctly. This includes charts, dynamic data, and lazy-loaded content.
Use the html parameter to pass your HTML string directly. SnapAPI, PDFShift, and DocRaptor all support this. No need to host or expose your template publicly.
For strict PDF/A compliance, DocRaptor with Prince is the strongest option. SnapAPI and PDFShift generate standard PDF 1.7 which is suitable for most business use cases but not formal PDF/A archival.
200 free PDF calls. Modern CSS. JavaScript rendering. HTML string support. No credit card required.
Start Free Migrating from wkhtmltopdf? →The right PDF API depends heavily on your use case. Here is a breakdown of the most common patterns and which service fits each one best.
Invoice generation is the most common PDF API use case. The typical pattern: render an HTML template
server-side with your data injected, then POST the HTML string to a PDF API. SnapAPI's
/v1/pdf endpoint accepts raw HTML with embedded CSS including Google Fonts, Tailwind utility classes,
and custom stylesheets. It renders the full page with Chromium, so what you see in the browser is
exactly what the PDF looks like — no CSS subset surprises, no missing fonts.
// Node.js: Generate PDF invoice from HTML template
const snapapi = require('snapapi-js');
const client = new snapapi.SnapAPI({ apiKey: process.env.SNAP_API_KEY });
async function generateInvoice(invoiceData) {
const html = renderInvoiceTemplate(invoiceData); // your template engine
const pdfBuffer = await client.pdf({
html,
format: 'A4',
margin: { top: '20mm', bottom: '20mm', left: '15mm', right: '15mm' },
printBackground: true
});
return pdfBuffer; // Buffer — upload to S3, email, or stream to browser
}
Compliance teams and legal departments need PDF snapshots of web pages at a point in time — terms of service versions, competitor pricing pages, contract proposals sent via web link. SnapAPI's URL-based PDF generation handles this with a single API call. The result is a pixel-accurate PDF of the live page as rendered by Chromium, including dynamic content loaded by JavaScript.
Many SaaS products offer a "Download as PDF" button for dashboards, analytics reports, and data views. The implementation pattern: generate the report as an HTML page with all data embedded, pass the URL or HTML to SnapAPI, and return the PDF to the user. SnapAPI handles SVG charts, Canvas-rendered graphs, and data tables correctly because it uses the same rendering engine as Chrome.
When choosing a PDF API in 2026, the most important factors are CSS fidelity, JavaScript rendering support, pricing at scale, and whether the service also handles adjacent tasks like screenshots and web scraping. Chromium-based APIs (SnapAPI, Browserless) produce the highest CSS fidelity. PDFShift and DocRaptor use different rendering engines that handle most standard CSS but can struggle with modern CSS Grid layouts, SVG animations, and Canvas elements. wkhtmltopdf is based on an abandoned Qt WebKit build and should not be used for new projects — it has no CSS Grid support, no SVG animation support, and security vulnerabilities that will not be patched.
curl "https://api.snapapi.pics/v1/pdf" -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" -d '{"url":"https://example.com","format":"A4"}' --output page.pdf
Sign up at snapapi.pics to get your free API key — 200 calls included, no credit card required. The free tier is enough to prototype and test your entire integration before committing to a paid plan.
Yes. You can specify A4, Letter, Legal, or custom width/height dimensions in millimeters or inches.
Yes, via CSS print media queries and the @page rule. Include your header/footer HTML in the page with position: fixed and SnapAPI renders them on every page.
SnapAPI handles HTML up to 10MB in the request body. For larger documents, pass a URL instead of raw HTML and SnapAPI fetches and renders it server-side.