The Markdown Template Approach
Rather than wrestling with HTML/CSS layouts or heavyweight PDF libraries, you write your document once in Markdown and parameterize the dynamic parts. Your application merges the data at runtime and sends the resulting string to/v1/render. The workflow looks like this:
Invoice Markdown Template
Below is a complete invoice template. The placeholders in{curly braces} are replaced by your application before the string is sent to the API.
The
metadata.title field you pass in the request body sets the PDF document title (visible in browser tab bars and PDF readers). Use the invoice number or report name for easy identification — for example "Invoice #1042 — Acme Corp".Code Example
This Python example fills the template, calls/v1/render, and saves the PDF to disk. You can adapt it to pull data from a database, a CRM, or a spreadsheet.
Financial Reports
The same template pattern works for any structured financial document. Common report types and their natural Markdown structures:Consistent Branding Across Documents
To maintain a uniform look across all your invoices and reports:- Apply a theme — set
"theme": "invoice"for invoices and receipts, or"report-clean"/"report-executive"for financial reports, so every document shares one design without repeating styling rules. - Keep header structure identical across templates — company name, address, and logo alt text in the same position every time.
- Use the same section hierarchy — H1 for the document title, H2 for major sections, H3 for subsections. Blink PDF applies consistent typographic styles to each level.
- Standardize table column widths by keeping column headers concise. Markdown tables auto-size based on content, so shorter headers produce tidier columns.
- Set
metadata.titleprogrammatically using a consistent naming convention (e.g.,"INV-{number} — {client}") so PDFs are identifiable in any file system or document management tool.
Need to generate dozens of invoices at once — for example, at month-end billing? See the Batch Processing guide to learn how to fire concurrent render requests within your plan’s rate limits.