Guide
Document structure
The skeleton every document shares — page setup and metadata in <config>, content under <pages>.
A document is an optional <config> (page size, margins, metadata, fonts)
followed by <pages>, the run of content. The root <document> takes a
version attribute — the PDF version to emit; it defaults to 1.7 when omitted,
and 2.0 is also fine.
Lengths accept px (= pt), pt, or mm — a bare number is points. Colors are
hex (#rgb, #rgba, #rrggbb, or #rrggbbaa — the last pair is alpha) or a CSS
color name (white, black, red, …).
<document version="2.0">
<config>
<page size="A4" margin="36px" />
<meta name="title" value="My Document" />
</config>
<pages>
<page>
<!-- elements go here -->
</page>
</pages>
</document><config> is optional — <document><pages><page>…</page></pages></document> is
a complete document, and pages then default to A4 with a 36pt margin. See the
Configuration guide for everything <config> holds.
A <layout> template may sit between <config> and <pages> to paint a header,
footer, or page number on every physical page; the page body flows in where its
<content/> marker sits. A <page> may carry its own <layout>
to override the document-wide one.
A <pdf> may also sit inside <pages>, beside <page>, to splice pages from an
external PDF straight into the output — a true merge, each source page kept at
its own size. See Importing PDF pages for src, the pages
selection, fidelity, and the fallback when the source can't be read.
<pages>
<page><!-- a cover you authored --></page>
<pdf src="brochure.pdf" pages="1-4,6, 8-10 20" />
</pages>