4

I am using markers and "retrieve-table-marker" in XSL-FO to create footers in a PDF transformation.

I need a solution where a one-column table has a "clean" footer and a multi-column table has a footer with added text ("continued") before each column-break. The added text should only be applied before the page break IF the table breaks between columns.

My current code almost does this. It works well for multi-column tables, but for a one-column table the "continued" text is added even though the table does not break.

The code:

  <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>
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Joneth
  • 91
  • 1
  • 9

1 Answers1

3

Alright, this worked for me:

I swapped

retrieve-position="first-including-carryover"

for

retrieve-position-within-table="last-ending-within-page"
Joneth
  • 91
  • 1
  • 9
  • Do you use antenna house ? Beacause I use fop and I always get a error message – bvb1909 Jun 17 '15 at 15:52
  • The OP was probably using XslFormatter; at that time FOP did not support `fo:retrieve-table-marker` elements, but it supports them now (FOP version >= 2.0), albeit with some limitations. – lfurini Jun 27 '15 at 08:26