Design your invoice in HTML and CSS. Send it to the API. Get a print-ready PNG back. No PDF libraries, no LaTeX, no design software required.
PDF libraries are complex. LaTeX is overkill. Puppeteer won't deploy on serverless. HTML + RenderPix is the shortest path.
Build the HTML string, POST it, get the image. Same pattern in Node.js, Python, PHP, or any language with an HTTP client.
import { renderInvoice } from './invoiceTemplate.js'
export async function generateInvoicePng(invoice) {
const html = renderInvoice(invoice) // your HTML template function
const res = await fetch('https://api.renderpix.dev/v1/render', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RENDERPIX_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
html,
width: 794, // A4 at 96 dpi
height: 1123, // A4 at 96 dpi
format: 'png',
}),
})
const { url } = await res.json()
const png = await fetch(url)
return Buffer.from(await png.arrayBuffer())
// → save to S3, attach to email, or stream to browser
}
| Approach | Designer-editable | Serverless-safe | Setup time | Full CSS |
|---|---|---|---|---|
| HTML + RenderPix | Yes | Yes | < 30 min | Yes |
| PDFKit / jsPDF | No | Yes | 1–2 days | No |
| Puppeteer | Yes | No | 2–4 hrs | Yes |
| WeasyPrint (Python) | Yes | With effort | 2–3 hrs | Partial |
| LaTeX | No | With effort | Days | No |
A4 at 96 dpi is 794×1123 px — use width: 794, height: 1123 in your request. For higher-resolution print output (300 dpi), use 2480×3508 px and scale your CSS accordingly with a wrapper transform: scale(3.125). Most email and download use cases are fine at 96 dpi.
RenderPix outputs PNG, JPEG, or WebP — not PDF. For most invoice delivery scenarios (email attachment, download link, archiving), PNG is sufficient. If you specifically need PDF, you can convert the PNG to PDF with a lightweight library like img2pdf (Python) or sharp + pdfkit (Node.js) after rendering.
Yes — RenderPix is a plain HTTP API. Render your invoice template to an HTML string using your framework's templating engine (Jinja2, Blade, ERB), then POST it to the API. See the Python tab above for a Django/Flask-compatible example.
Yes. Reference images with <img src="https://..."> pointing to a public URL, or embed them as Base64 data URIs directly in the HTML. The renderer loads all external resources before capturing, so your logo will appear in the output.
Free tier: 100 renders/month, no credit card. Starter plan is $9/month for 2,000 renders — enough for most SaaS products that generate invoices per billing cycle. For high-volume billing systems, check the pricing page for volume plans.
No PDF libraries, no Chromium binaries. Free tier, no credit card required.