Generate invoice PDFs from HTML templates
Turn an HTML invoice template into a pixel-faithful PDF via API: template with your stack, style with CSS, POST to /v1/render. Example included.
Invoices are the classic HTML→PDF workload: you already have the data, HTML+CSS is the easiest layout language you know, and the output must look identical every time. The pattern:
- Keep one
invoice.htmltemplate in your codebase (any template engine — Jinja2, ERB, Handlebars, Blade …). - Render it with the invoice data → an HTML string.
POST /v1/render→ store or email the returned PDF.
<style>
@page { size: A4; margin: 20mm;
@bottom-center { content: "Page " counter(page) " of " counter(pages); } }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 6px 8px; border-bottom: 1px solid #ddd; }
.total { font-weight: bold; }
</style>
<h1>Invoice 2026-001</h1>
<table>
<tr><th>Item</th><th>Qty</th><th>Price</th></tr>
<tr><td>Design work</td><td>12 h</td><td>1,200.00 €</td></tr>
<tr class="total"><td>Total</td><td></td><td>1,200.00 €</td></tr>
</table>
Logos go in as data: URIs (how); the
rendering is deterministic — same HTML in, same PDF out.
Operational notes
Renders are synchronous and bounded (20 s timeout, 50 pages) — an invoice renders in well under a second, so you can generate it inline in the request that closes the order. One render costs one credit; a failed render (5xx) auto-refunds the credit. pdfrender stores nothing: the PDF exists only in the response.
Try it free
Paste your invoice template into the free browser tool, then try the API free — 100 renders a month, no card.