HTML to PDF API —
Generate PDFs from Any URL
Convert any webpage or raw HTML to a pixel-perfect PDF. Custom page sizes, margins, backgrounds, and headers — one API call, no browser to manage.
PDFs that look exactly
like the webpage.
Any page size
A4, Letter, Legal, Tabloid, or custom dimensions. Set exact width and height for non-standard sizes like receipts or labels.
Backgrounds & colors
Set print_background: true to preserve CSS backgrounds, gradients, and colors. No more washed-out PDFs.
Custom margins
Control top, right, bottom, and left margins independently. Set in inches, millimeters, or centimeters.
Raw HTML input
Pass an HTML string instead of a URL. Render invoices, reports, or certificates from your own templates without hosting them.
URL in, PDF out.
No wkhtmltopdf. No Puppeteer. Just one HTTP call.
curl -X POST https://api.snaprender.dev/v1/pdf \
-H "x-api-key: sr_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/invoice/1234",
"format": "A4",
"print_background": true,
"margin": { "top": "1in", "bottom": "1in" }
}' --output invoice.pdfPDFs for every workflow.
Invoices & receipts
Render your invoice template as a URL, convert to PDF, and email to customers. No PDF library to maintain — just HTML and CSS.
Reports & dashboards
Export data dashboards, analytics reports, or financial summaries as PDFs. Preserve charts, tables, and formatting exactly.
Certificates & badges
Generate personalized certificates, completion badges, or award documents. Pass dynamic data via URL parameters or raw HTML.
Contracts & proposals
Convert web-based contracts, proposals, or terms of service to PDF for signing and archival. Professional formatting guaranteed.
$0.006 per PDF.
Same flat price whether it's a single-page receipt or a 50-page report. No per-page charges, no credit multipliers. 100 free requests/month to start.
Questions & answers
A4, Letter, Legal, Tabloid, and custom dimensions. You can set exact width and height in inches or millimeters for any non-standard size.
Yes. Pass your HTML string in the html parameter instead of a URL. SnapRender renders it in a real browser and converts to PDF — CSS, web fonts, and images all work.
Yes. Set print_background: true to include CSS backgrounds and colors. Control margins individually (top, right, bottom, left) in inches or millimeters.
Yes. The API supports custom header and footer HTML templates with automatic page numbers, dates, and title injection.
Typical response time is under 2 seconds. Complex pages with heavy JavaScript may take slightly longer. The API waits for full page load before rendering.