Appearance
Document
The top-level <document> element of a press file defines the overall structure and design of the resulting document.
Its contents consists primarily of pages, each of which must have a defined width and height and can contain any content you wish.
Pages may be defined within the <document> tag using elements called <page>. Pages may include any content, or references to flows.
The <document> tag can specify the default style attributes for pages. For example,
xml
<document width="595pt" height="842pt" padding="72pt">
...
</document>states that, unless they explicitly override it all pages should be 595pt x 842pt with a margin on all sides of 72pt.
<pages>
Additionally, if you want to use a given page template more than once, rather than having to copy and paste it throughout the <document> structure, you can instead provide a "definition" in the press file's <pages> element. These can then be referenced simply by their name.
For example,
xml
<pages>
<break-page>
...
</break-page>
<my-page>
...
</my-page>
</pages>
<document>
<my-page />
<break-page />
<my-page />
</document>Similar to document, the <pages> element can specify the default attributes of a page.
Required Flows
Pages used within the document structure can also specify a list of "required flows" using the syntax <page-name flow="flow-one; flow-two; ..." />. The page will only be displayed if all required flows have content to be drawn from. If one or more are empty, the page will be skipped.
For example, if cover-page, body-page, and info-page are page definitions provided in pages, then the following document structure would create a cover page, followed by an optional "info page" (which would exist only if the information flow is non-empty), and finally a number of body pages, reading from the body flow:
xml
<document>
<cover-page />
<info-page flow="information" />
<body-page repeat="true" flow="body" />
</document>Page Formats
For simplicity, common page sizes can be specified using the format attribute, e.g.<page format="a4">. The currently supported formats are:
| Format | Dimensions |
|---|---|
| A0 | 84.1cm x 118.9cm |
| A1 | 59.4cm x 84.1cm |
| A2 | 42cm x 59.4cm |
| A3 | 29.7cm x 42cm |
| A4 | 21cm x 29.7cm |
| A5 | 14.85cm x 21cm |
| A6 | 10.5cm x 14.85cm |
| A7 | 7.4cm x 10.5cm |
| A8 | 5.2cm x 7.4cm |
| A9 | 3.7cm x 5.2cm |
| A10 | 2.6cm x 3.7cm |