Skip to content
Multi-Page Content

Multi-Page Content

Content reaches the next page in one of two ways:

  • An object placed with <PlaceObject> stays in one piece. When it does not fit below what is already in the frame, it moves to the next frame of its area, or to a new page once the frames are used up.
  • The content of a <Flow> breaks: paragraphs between lines, tables between rows. The rest continues in the next frame or on the next page.

Text across pages

Put running text into a <Flow>. It starts new pages by itself, as many as the text needs:

<Record match="article">
    <Flow area="text">
        <ForAll select="para">
            <Paragraph><Value select="."/></Paragraph>
        </ForAll>
    </Flow>
</Record>

The chapter Flowing Text explains how a flow fills the grid, which commands it takes, and how to control the breaks with CSS.

Tables across pages

A table in a <Flow> breaks across frames and pages. Its rows are laid out down the frame, and when the next row does not fit, the table continues in the next frame of the area, or on a new page once the frames are used up. The rows of a <TableHead> are repeated at the top of every continuation:

<Flow>
    <Table>
        <TableHead>
            <Tr><Td><Paragraph><Value>Header</Value></Paragraph></Td></Tr>
        </TableHead>
        <!-- Hundreds of rows... they'll flow to new frames and pages automatically -->
    </Table>
</Flow>

A <TableFoot> works the other way around: its rows are placed at the end of the table, and when the table breaks, they are repeated at the bottom of every fragment. Rows that a cell with rowspan joins go to the next frame together.

A table placed with <PlaceObject> is kept whole, like any other object: if it does not fit below what is already in the frame, it moves to the next frame or page as one piece. A table taller than every frame of its area cannot be placed whole and is an error; put it into a <Flow> to let it break.

Individual table cells are never split – each cell is rendered as a single box. If a row doesn’t fit in the current frame, it moves to the next one. A row taller than an empty frame is placed and allowed to overflow.

Page breaks

Force a new page with <ClearPage>:

<Record match="catalog">
    <ForAll select="category">
        <ProcessNode select="."/>
        <ClearPage/>
    </ForAll>
</Record>

Frame switching

If an area has multiple frames, use <NextFrame> to jump to the next one:

<NextFrame area="text"/>

If there’s no next frame, a page break is inserted and content continues in the first frame of the area on the new page.

<ClearPage> and <NextFrame> are not allowed inside a <Flow>. There, the CSS properties break-before and break-after do the same: page (or left, right) for a new page and column for the next frame.

Positioning frames for multi-column layouts

Define multiple frames within a single area to create flowing multi-column layouts:

<DefineMasterPage name="threeColumn" test="true()" margin="1cm">
    <PositioningArea name="text">
        <PositioningFrame width="5" height="20" row="1" column="1"/>
        <PositioningFrame width="5" height="20" row="1" column="7"/>
        <PositioningFrame width="5" height="20" row="1" column="13"/>
    </PositioningArea>
</DefineMasterPage>

Content placed in the “text” area fills the first column, then flows to the second, then the third. When all three are full, a new page is created and the cycle repeats. Objects placed with <PlaceObject> jump to the next column as a whole; with <Flow area="text"> the text breaks at the bottom of each column and continues at the top of the next one.

See also