Contents | < Paragraphs | Inline Text Formatting >
XSL-FO documents have flow layout, that is, content "flows" from one page to the next one:
<fo:flow flow-name="PageBody" font="bold 12pt Arial">
<fo:block border="0.5pt solid blue" space-after="5pt">
This is a first block element.
</fo:block>
<fo:block border="0.5pt solid blue" space-after="5pt">
The content of this block is split across multiple pages.
...
</fo:block>
<fo:block border="0.5pt solid blue" keep-together="always" >
The content of this block is not split because
keep-together is set.
...
</fo:block>
<fo:block border="0.5pt solid blue" space-after="5pt"
keep-with-next="always" >
A block element that still fits on the second page.
</fo:block>
<fo:block border="0.5pt solid blue">
A block on the third page. The previous block will be
displayed on the second page because it has
keep-with-next flag set.
</fo:block>
</fo:flow>
![]() | For the complete source code for this code example see "Tutorial/Flow Layout.fo" located under XML Documents Samples/Tutorial folder. |
The result of rendering is displayed in following figure.

Figure 1
There are several properties that control how and when a block of text is split across multiple pages. They are:
Contents | < Paragraphs | Inline Text Formatting >