Zibbobz
Zibbobz

Reputation: 755

XSL-FO Body Overflows Footer

In my current XSL-FO Master-Flow declaration, my body section overflows my footer.

w.write("<fo:simple-page-master master-name=\"main-master\" "); 
w.write("page-height=\"11in\" page-width=\"8.5in\" margin-top=\".5in\" ");\
w.write("margin-bottom=\".5in\" margin-left=\".5in\" margin-right=\".5in\">");  
//w.write("<fo:region-body margin-top=\"20mm\" margin-bottom=\"4in\"/>");
w.write("<fo:region-body margin-top=\"25mm\" margin-bottom=\"1in\" space-after=\"1.5in\"/>");
w.write("<fo:region-before  extent=\"13mm\"/>");
w.write("<fo:region-after region-name=\"footer\"  extent=\"0mm\"/>");
w.write("</fo:simple-page-master>");

As suggested in this question I have tried adjusting the margin-bottom and extent of region-after, to no avail. Previously the margin-bottom was set to 4 inches to prevent this (due to the large image needed at the bottom of my page body) but this creates an unsightly large empty space at the bottom of each page. And space-after does not seem to help either.

How can I prevent the body of my xsl-fo text from overflowing onto my footer?

Upvotes: 1

Views: 767

Answers (1)

jBravo
jBravo

Reputation: 883

You may use a fo:static-content element that refers to your region-after footer .See the example bellow :

<xsl:template name="Main" match="/">
    <fo:page-sequence master-reference="main-master" >
        <fo:static-content flow-name="footer">
            <xsl:call-template name="MyFooter"/>
        </fo:static-content>
        <fo:flow>
            ...
        </fo:flow>
    </fo:page-sequence>
</xsl:template>

From W3Schools :

The object contains static content (e.g. headers and footers) that will be repeated on many pages.

The object has a "flow-name" property that defines where the content of the object will go.

Upvotes: 2

Related Questions