Generate invoice PDFs from HTML
Most apps already have the invoice data. The simplest reliable pipeline is an HTML template, then an API call, then a PDF.
Sizing
- A4:
"width": 794, "height": 1123. US Letter:"width": 816, "height": 1056. - Leave
fullPageoff so long invoices flow onto more pages of that size. Use CSSbreak-inside: avoidon table rows. - Add margins with padding. The PDF has none by default.
Request
curl -X POST https://api.frameforgeapi.com/render -H "X-API-Key: $FRAMEFORGE_KEY" -H "Content-Type: application/json" \
-d '{"html":"<h1>Invoice #1001</h1><p>Total: £49.00</p>","format":"pdf","width":794,"height":1123}' --output invoice.pdf
Language-specific versions: HTML to PDF in Node.js · HTML to PDF in Python · HTML to PDF in PHP · HTML to PDF in Ruby · HTML to PDF in Go · HTML to PDF in Java.
No-code
From n8n or Make, use an HTTP Request node or module: POST JSON to /render with the X-API-Key header and set the response to file or binary. Then attach the result to an email or upload it to Drive.