PDF invoice generation API
Turn your HTML invoice templates into pixel-perfect PDFs with a single request — dynamic data, your own CSS, no browser to run.
Generating invoices as PDFs is the classic HTML-to-PDF job: you already have an HTML template, you just need a reliable, identical-every-time PDF out the other side. Rolling your own means installing a PDF library or running headless Chromium in production and keeping it alive.
Rendershot does it as an API call. POST your rendered invoice HTML (with the customer's data filled in) to the PDF endpoint, choose A4 or Letter, and get back PDF bytes to email, store, or stream — rendered on real Chromium so your CSS, web fonts, and layout look exactly as designed.
Send your invoice HTML, get a PDF back:
curl -X POST https://api.rendershot.io/v1/pdf \
-H 'X-API-Key: sk_live_...' \
-H 'Content-Type: application/json' \
-d '{"html":"<html>…your invoice template…</html>","format":"A4"}' \
--output invoice-123.pdfPixel-perfect from HTML
Real Chromium renders your template — web fonts, flexbox, and print CSS all behave, no layout surprises.
Dynamic per-invoice data
Fill your template server-side, send the finished HTML; every invoice renders identically.
Page size & margins
A4, A3, Letter, or Legal, portrait or landscape, with custom margins and printed backgrounds.
No browser to run
No wkhtmltopdf binary, no headless Chrome to scale — one HTTPS call per invoice.
Async, bulk & scheduled
Generate in bulk, queue large batches, or schedule recurring statements, with webhooks on completion.
Store or email the bytes
Get raw PDF bytes back to upload to S3, attach to an email, or stream to the browser.
FAQ
How do I generate a PDF invoice from HTML?
Render your invoice template to an HTML string with the customer's data, then POST it to Rendershot's /v1/pdf endpoint with format A4 (or Letter). You get back PDF bytes to store, email, or download — no PDF library or headless browser required.
Will my CSS and fonts render correctly?
Yes. Rendershot renders with real Chromium, so web fonts, modern CSS, and print styles produce the same output you'd see in Chrome — important for consistent, branded invoices.
Can I generate invoices in bulk or on a schedule?
Yes. Use async mode for large batches and webhooks to be notified on completion, or schedule recurring statement generation with cron-based scheduled captures.
Is there a free tier?
Yes — the free plan includes 200 renders per month with no credit card, enough to wire up and test invoice generation end to end.
Start rendering in minutes
Free plan includes 200 renders/month. No credit card required.
Start for free →