Invoices  ·  HTML to Image

Generate invoice images
from HTML templates

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.

Start Free — 100 renders/mo View API Docs
The Problem

Generating invoices programmatically is harder than it should be

PDF libraries are complex. LaTeX is overkill. Puppeteer won't deploy on serverless. HTML + RenderPix is the shortest path.

PDF generation libraries
PDFKit, jsPDF, ReportLab — all require learning a proprietary layout API. Every box, line, and font call is manual. Pixel-perfect results take days. Designers can't touch the template because it's code, not HTML.
Design in HTML, render via API
Your invoice is an HTML file. Any designer can edit it. Any developer can inject data with template literals or a templating engine. One API call renders it to a print-ready PNG at any resolution.
Puppeteer on your server
A Chromium process for invoice generation uses 300–500 MB RAM per instance, crashes on cold starts, and blocks your serverless deploys. Keeping it alive in production is a full-time DevOps problem.
Serverless-safe API call
RenderPix runs the Chromium cluster. Your app makes one HTTP request. No binary in your bundle, no memory management, no cold start. Works on Vercel, Lambda, Railway, and every serverless platform.
Code Example

Invoice generation in any framework

Build the HTML string, POST it, get the image. Same pattern in Node.js, Python, PHP, or any language with an HTTP client.

Node.js
Python
HTML template
invoice.js
server-side
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
}
How It Works

Design once, generate at scale

01
Design your invoice template
Write an HTML/CSS invoice template. Use any layout — tables, flexbox, grid. Inject placeholder variables for invoice number, line items, totals, and customer details.
02
Fill and render on demand
At invoice generation time, inject real data into the template using your templating engine, then POST the HTML to the API. A4 dimensions (794×1123 px at 96 dpi) produce print-ready output.
03
Save, email, or archive
Get PNG bytes back. Upload to S3, attach to a SendGrid email, serve as a download link, or store in your database. Any workflow that handles image bytes works.
Comparison

HTML invoices vs the alternatives

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
FAQ

Common questions

What dimensions should I use for A4 invoices?

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.

Can I generate a PNG instead of a PDF?

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.

Does it work with Django, Laravel, or Rails?

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.

Can I include a logo or signature image in the invoice?

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.

What does it cost for invoice generation at scale?

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.

Generate invoice images from HTML in minutes

No PDF libraries, no Chromium binaries. Free tier, no credit card required.