Skip to main content
Invoices, statements, and financial reports share a simple structure — a header, a table of line items, a summary, and some footer metadata. Markdown handles all of that cleanly, which makes Blink PDF an ideal engine for document generation at any scale. You define a template once, fill in the variables at runtime, and receive a print-ready PDF in about 100ms with no layout code to maintain.

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:
Tables, bold text, horizontal rules, and headings all render cleanly into professionally typeset PDF pages.

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:
For multi-page reports, use horizontal rules (---) to visually separate major sections. Blink PDF automatically handles page breaks, so you don’t need to manage pagination manually.

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.title programmatically 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.