Generate PDF invoices from HTML

Turn your existing HTML invoice templates into clean, branded PDFs with a single API call — pixel-accurate, fast, and built for end-of-cycle bursts.

From HTML template to billable PDF

Most billing systems already have the invoice as HTML — a template with the customer, line items, totals, and your branding. The hard part is turning that into a consistent PDF your customer can download, archive, or attach to an email.

pdfkitt takes the rendered HTML and returns a finished PDF. Because it uses Chromium, the invoice looks exactly as it does in the browser: the same CSS, the same web fonts, the same spacing — no surprises between preview and print.

Why teams use an API for invoices

Invoices are often generated in bursts — at the end of a billing cycle, thousands at once. Self-hosting a renderer means provisioning for that peak and keeping it patched. An API absorbs the spike for you and bills by document, so a quiet month costs less.

Sensitive billing data also argues for care: pdfkitt processes HTML in memory and does not retain document content, so invoice details are never stored after the PDF is returned.

Example: render an invoice in Python

import os
import requests

# Render your HTML invoice template (e.g. with Jinja2), then convert it.
resp = requests.post(
    "https://api.pdfkitt.dev/v1/convert",
    headers={"Authorization": "Bearer " + os.environ["PDFKITT_API_KEY"]},
    json={"html": invoice_html, "options": {"page_size": "A4"}},
)
resp.raise_for_status()

with open("invoice-1001.pdf", "wb") as f:
    f.write(resp.content)

Try pdfkitt free — 1,000 PDFs/month, no credit card

Get an API key and generate your first document in minutes.