Custom footer (xsl-region-after) for last page

Oct 11, 2011 at 5:57 PM
Hi, I tried to generate footers for the last page of my document, but it seems that this rendering does not run, I tried with xalan (java) and working properly, I leave the template example:

 <?xml version="1.0"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <fo:layout-master-set>
  <fo:simple-page-master master-name="first" page-height="297mm" page-width="210mm" margin-top="20mm" margin-bottom="20mm" margin-left="25mm" margin-right="25mm">
   <fo:region-body margin-bottom="20mm"/>
   <fo:region-after region-name="footer-first" extent="20mm"/>
  </fo:simple-page-master>
  <fo:simple-page-master master-name="rest" page-height="297mm" page-width="210mm" margin-top="20mm" margin-bottom="20mm" margin-left="25mm" margin-right="25mm">
   <fo:region-body margin-bottom="20mm"/>
   <fo:region-after region-name="footer-rest" extent="20mm"/>
  </fo:simple-page-master>
  <fo:simple-page-master master-name="last" page-height="297mm" page-width="210mm" margin-top="20mm" margin-bottom="20mm" margin-left="25mm" margin-right="25mm">
   <fo:region-body margin-bottom="20mm"/>
   <fo:region-after region-name="footer-last" extent="20mm"/>
  </fo:simple-page-master>
  <fo:page-sequence-master master-name="document">
   <fo:repeatable-page-master-alternatives>
    <fo:conditional-page-master-reference page-position="first" master-reference="first"/>
    <fo:conditional-page-master-reference page-position="rest" master-reference="rest"/>
    <fo:conditional-page-master-reference page-position="last" master-reference="last"/>
   </fo:repeatable-page-master-alternatives>
  </fo:page-sequence-master>
 </fo:layout-master-set>
 <fo:page-sequence master-reference="document">
  <fo:static-content flow-name="footer-first">
   <fo:block text-align="center">First page.-<fo:page-number/>
   </fo:block>
  </fo:static-content>
  <fo:static-content flow-name="footer-rest">
   <fo:block text-align-last="center">Other page.-<fo:page-number/>
   </fo:block>
  </fo:static-content>
  <fo:static-content flow-name="footer-last">
   <fo:block text-align-last="center">Last page.-<fo:page-number/>
   </fo:block>
  </fo:static-content>
  <fo:flow flow-name="xsl-region-body">
   <fo:block/>
   <fo:block break-before="page"/>
  </fo:flow>
 </fo:page-sequence>
</fo:root>

Thank you in what you can support.

Coordinator
Oct 17, 2011 at 6:49 PM

Hi

Unfortunately page-position="last" is not supported in FO.NET. This is a limitation of the way FO.NET works in a single pass - it does not know if the page is the last one until way after the page master has been chosen.

Sorry I can't help!

Mark

Nov 3, 2011 at 5:51 PM

Thanks Mark, i made a "patraña", i don't know how says it in english :P, and insert new page at end.