我在 XSL-FO 中使用标记和“检索表标记”在 PDF 转换中创建页脚。
我需要一个解决方案,其中单列表有一个“干净的”页脚,而多列表的页脚在每个分栏符之前添加了文本(“续”)。如果表格在列之间换行,则仅应在分页符之前应用添加的文本。
我当前的代码几乎可以做到这一点。它适用于多列表,但对于单列表,即使表格没有中断,也会添加“继续”文本。
编码:
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>
<fo:marker marker-class-name="footer-continued">(continued)</fo:marker>
</fo:block>
<fo:block>
<xsl:text>Contents</xsl:text>
</fo:block>
<fo:block>
<fo:marker marker-class-name="footer-continued"></fo:marker>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
<fo:table-footer>
<fo:table-row>
<fo:table-cell>
<fo:block>
<fo:retrieve-table-marker retrieve-class-name="footer-continued"
retrieve-position="first-including-carryover"
retrieve-boundary-within-table="table"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-footer>