XSL FO继续/运行表格,页脚中的标记

时间:2011-11-30 12:59:52

标签: xml pdf-generation xsl-fo marker xmltable

我在XSL-FO中使用标记和“retrieve-table-marker”来创建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>

1 个答案:

答案 0 :(得分:3)

好吧,这对我有用:

我换了

retrieve-position="first-including-carryover"

retrieve-position-within-table="last-ending-within-page"