Nwilan Glirt wrote:
Now that I discovered that page-position="last" is not implemented in
FOP, I am looking for alternative ways to produce "first", "middle" and
"last" specific pages. Is there any way to do some conditional stuff on
blocks such as testing if we are currently writing the last page?
Askinig for page-position="last" seems to be thequestion of
the week.
If creation time is uncritical, a two pass solution can provide
this. The generated FO uses a repeatable--page-master-reference
or a repeatable-page-master-alternatives for the main document body,
in the first pass the maximum-repeats is unbounded (very large),
in the second pass it is restricted to the relevant page count so
that the next page master can kick in for the last page.
In the XSLT, declare a parameter for the page count and something
like this:
<xsl:param name="page-count"/>
<xsl:template name="generate-page-master">
<fo:page-sequence-master master-name="all">
<!-- page master for first page -->
<fo:single-page-master-reference master-reference="first"/>
<!-- page master for rest -->
<fo:repeatable--page-master-reference master-reference="rest"
maximum-repeats="{$page-count}"/>
<!-- page master for last, unused in first pass (no harm) -->
<fo:repeatable--page-master-reference master-reference="last"/>
</fo:page-sequence-master>
</xsl:template>
There has been sample Java code published on this list for automating
the whole process:
http://marc.theaimsgroup.com/?l=fop-user&m=102002702026609&w=2
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]