xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <j3322...@yahoo.de>
Subject Re: page-position="last"
Date Tue, 03 Sep 2002 20:24:53 GMT
Davide Raschetti wrote:
> I've a different footer for the last page, I have tried with page-sequence-master-reference:
> 
> <fo:page-sequence-master master-name="A4">
> <fo:repeatable-page-master-alternatives>
> <fo:conditional-page-master-reference master-reference ="document" page-position="rest"
/> 
> <fo:conditional-page-master-reference master-reference ="enddocument" page-position="last"/>
> </fo:repeatable-page-master-alternatives>
> </fo:page-sequence-master>
> 
> but this don't work because every pages are are recognized like 'last pages'.
> 
> There is an other way to recognize the last page?  

Implementing a last page recognition is more tricky than
most people think, therefore FOP currently does not support
it.

There are several posibilities to work around this restriction
in certain circumstances.
1. If some text should be added to the footer, and the text fits
in the general footer extent, put a fo:marker with the text at
the end of the flow and use fo:retrieve-marker in the footer.
2. Check docs/examples/markers/hide.fo for a more tricky
use case.
3. Use a footnote with an empty inline at the end of the flow.
Note that there is a bug which causes the whole footnote to be
dropped if it wont fit on the page.
4. Use a two pass solution, you must use some XSLT in this case.
For example, write in your XSLT
   <fo:page-sequence-master master-name="A4">
     <fo:repeatable-page-master-reference
        master-reference ="document"
        maximum-repeats="{$pages}"/>
     <fo:repeatable-page-master-reference
        master-reference ="enddocument"/>
   </fo:page-sequence-master>
and pass for the first pass a large number or "no-limit"
as the value for the XSLT parameter named "pages". Watch
how many pages are created, and then repeat with the number
of pages genearted minus 1.
You can build a simple Java wrapper to automate this process,
look here for sample code:
  http://marc.theaimsgroup.com/?l=fop-user&m=102002702026609&w=2

J.Pietschmann


Mime
View raw message