Document
The outermost container, holding every Layout and an optional Numbering config.
A Document is the root of the tree that Format renders into a PDF. Everything you author lives inside it: the Layouts that describe each page and the Flows whose content paginates across them. It also carries the PDF's metadata: the title, subject, author, and keywords.
Fields
| Name | Type | Description |
|---|---|---|
titleRequired | string | The document title. Written to the rendered PDF as its title metadata and used in the Format Dashboard for filtering and reporting. |
subject | string | The document subject. Written to the rendered PDF as its subject metadata. |
author | string | The document author. Written to the rendered PDF as its author metadata. |
keywords | string | Comma-separated keywords. Written to the rendered PDF as its keyword metadata and used in the Format Dashboard for filtering and reporting. |
fontMode | string | The font strategy from <Document fonts>, either "compact" or "fidelity". Carried through verbatim with no default applied, and omitted entirely when unset. |
Example
A minimal document. One Layout, one Flow, one rendered page.
Usage
Document is the root container, and there is exactly one. Set its title (required) plus any of subject, author, and keywords to populate the rendered PDF's metadata, then nest your Layouts inside.
If your codebase produces several distinct PDFs, each compiles to its own Document (one per entry point). You can't render two Documents in a single render call.
What goes inside
Two kinds of children sit directly inside a Document:
- Layouts. Page designs that produce pages. At least one, otherwise nothing renders. Each Layout holds the Flows that paginate its content.
- A Numbering config. An optional
<Numbering>block sets the document-wide counter style for headings, figures, and footnotes. At most one.
Each Layout produces its own run of pages in source order, so a Document with two Layouts renders the first run, then the second.
PDF metadata
The title, subject, author, and keywords fields map to the rendered PDF's metadata block.