Reputation: 2370
i'm using xsl fo and apache fop to generate pdf documents. i have different fo page-sequences (coverpage, toc, imprint and the "main content").
In the main content i handle the datas from the xml file, it's fine.
At the beginning of the main content i started count the pages and show this in the bottom/right. With this i had a problem that it show a blank page before the "main content", i could resolve this issue with adding "force-page-count="no-force" on the page-sequence before.
But i have a blank page after the main-content sequence, any idea how can i solve this?
page-sequence before main-content:
<fo:page-sequence master-reference="imprint" force-page-count="no-force">
...
</fo:page-sequence>
main-content:
<fo:page-sequence master-reference="per-Gruppe" initial-page-number="1">
<fo:static-content flow-name="header">
<xsl:call-template name="doc-header" match=""/>
<fo:block/>
</fo:static-content>
<fo:static-content flow-name="footer">
<xsl:call-template name="doc-footer"/>
<fo:block/>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:for-each select="//lb">
<xsl:call-template name="Kapitel" select="name"/>
<xsl:for-each select="per-group/pe">
<xsl:call-template name="st.Table" select="."/>
</xsl:for-each>
<xsl:for-each select="cu-group/cu">
<xsl:call-template name="st.Table" select="."/>
</xsl:for-each>
<xsl:if test="position()=last()">
<fo:block id="lastpage"/>
</xsl:if>
</xsl:for-each>
</fo:flow>
</fo:page-sequence>
Any suggestions?
Thanks.
Upvotes: 1
Views: 2286
Reputation: 2370
OK, i solve it. i do the following steps.
page-sequence:
<xsl:for-each select="//lb">
<xsl:choose>
<xsl:when test="position() = 1">
<fo:page-sequence master-reference="per-Gruppe" initial-page-number="1">
...
</fo:page-sequence>
</xsl:when>
<xsl:otherwise>
<fo:page-sequence master-reference="per-Gruppe">
...
<fo:flow flow-name="xsl-region-body">
...
<xsl:for-each select="cu-group/cu">
<xsl:call-template name="st.Table" select=".">
<xsl:with-param name="last_pos" select="$last_pos" />
</xsl:call-template>
</xsl:for-each>
</fo:flow>
</fo:page-sequence>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
template:
<xsl:template name="st.Table" match=".">
<xsl:param name="last_pos" select="false()" />
...
<xsl:if test="$last_pos">
<fo:block id="lastpage"/>
</xsl:if>
<xsl:if test="$last_pos=false()">
<fo:block page-break-after="always" />
</xsl:if>
</xsl:template>
Upvotes: 4