XSL-FO Body溢出页脚

时间:2015-07-23 20:05:16

标签: java xsl-fo apache-fop

在我目前的XSL-FO Master-Flow声明中,我的身体部分溢出了我的页脚。

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>");

正如this question中所建议的那样,我曾尝试调整后边距和区域范围,但无济于事。之前将边距底部设置为4英寸以防止这种情况(由于我的页面底部需要大图像)但这会在每个页面的底部创建一个难看的大空白空间。而且之后的空间似乎也没有帮助。

如何防止我的xsl-fo文本正文溢出到我的页脚?

1 个答案:

答案 0 :(得分:1)

您可以使用引用fo:static-content页脚的region-after元素。请参阅下面的示例:

<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>

来自W3Schools

  

该对象包含静态内容(例如标题   和页脚会在很多页面上重复出现。

     

该对象具有定义的“flow-name”属性   对象内容的去向。

相关问题