'xslfo: staticcontent overlap to flow

I have an arrangement like this in scala using xslfo:

PageSequence(
   Seq(
       Fo.staticContent(....),
       Fo.staticContent(....),
       Fo.staticContent(....)
    ),
    Fo.flow(...)
)

Content of staticcontent objects may vary. It is causing staticcontent part to sometime overlap flow part.

How can I avoid this? I see static-content has no attribute for adjusting height.



Solution 1:[1]

The allowed height of the static content comes from the extent property of the region that receives the static content.

Static content flows into one of the 'outer' regions: fo:region-before, fo:region-after, fo:region-start, or fo:region-end.

The correspondence between the flow-name property on the fo:static-content and the region-name property on the region FO determines which of the regions receives the static content: you could, for example, have the same static content that appears in the fo:region-start on left-hand pages and in the fo:region-end on right-hand pages, or you could have static content that appears only on the first page of a page sequence (when the first page uses a separate fo:simple-page-sequence).

The extent property (see https://www.w3.org/TR/xsl11/#extent) determines the height or width of the outer region.

The content of the fo:static-content can overflow its extent. For fo:region-before, it might overlap the fo:region-body, and for fo:region-after, it might overflow off the bottom of the page.

Note that fo:region-body can have margins specified so that it does not (ordinarily) overlap the outer regions.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tony Graham