Skip to content

Structure

A template is rendered with POST /render/template. The request body has two top-level fields:

  • template — the document definition (required). See its fields below.
  • data — per-block content overrides keyed by block id. Use this to render the same template with different content.

The template object is built from these fields:

  • version — schema version of the template format.
  • config — document-wide settings:
    • title — the PDF document title (required by PDF/UA). Defaults to Document.
    • pagesize, locale, margins, pageNumbers, optional background, and repeating footer rows.
    • typography — default font family, size, weight, align, and color. Inherited by every block unless overridden on the block’s own config.typography.
    • embedColorProfile — defaults to true; set to false only when you need PDF/UA output without the PDF/A color profile, for example benchmark size comparisons.
  • fonts — optional map of custom font families to load by URL. See External Fonts.
  • attachments — optional PDF/A-3 file attachments embedded into the output.
  • rows — the ordered list of rows that make up the body of the document. Each row contains one or more blocks that lay out side by side using each block’s config.width.

A block belongs to one of the following types. All of them carry a common config for typography, spacing, width, and alignment:

  • text — paragraph copy.
  • heading — a heading at a configurable level.
  • table — a table built from rows of typed cells, with automatic pagination.
  • image — an inline image referenced by URL or data URI.
  • key-value — labelled key/value pairs, typically used for invoice metadata.
  • divider — a horizontal rule with configurable style (solid, dashed, dotted, double, none).
  • spacer — vertical whitespace.
  • html — a raw HTML escape hatch when nothing else fits.

Edit the JSON and click Render PDF.