different body on last page

Here should go questions about transforming XML with XSLT and FOP.
pedro.riky
Posts: 16
Joined: Thu Mar 01, 2007 2:19 pm

different body on last page

Post by pedro.riky »

i want thath my FOP generate a pdf with a different body section for the last page, i try to implement this behaviour like this:

Code: Select all


<xsl:template match="/fatture">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

<fo:layout-master-set>
<fo:simple-page-master master-name="main" page-height="297mm" page-width="210mm"
margin-top="0mm" margin-bottom="5mm" margin-left="5mm" margin-right="5mm">
<fo:region-body margin-top="110mm" margin-bottom="75mm"/>
<fo:region-before extent="110mm"/>
<fo:region-after extent="75mm"/>
</fo:simple-page-master>

<fo:simple-page-master master-name="main-other" page-height="297mm"
page-width="210mm" margin-top="0mm" margin-bottom="5mm" margin-left="5mm"
margin-right="5mm">
<fo:region-body margin-top="110mm" margin-bottom="75mm"
region-name="xsl-region-body"/>
<fo:region-before extent="110mm" region-name="xsl-region-before"/>
<fo:region-after extent="75mm" region-name="xsl-region-footer"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="main-last" page-height="297mm"
page-width="210mm" margin-top="0mm" margin-bottom="5mm" margin-left="5mm"
margin-right="5mm">
<fo:region-body margin-top="110mm" margin-bottom="75mm"
region-name="xsl-region-body-last"/>
<fo:region-before extent="110mm" region-name="xsl-region-before"/>
<fo:region-after extent="75mm" region-name="xsl-region-footer"/>
</fo:simple-page-master>

<fo:page-sequence-master master-name="sintetica">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="main-last"
page-position="last"/>
<fo:conditional-page-master-reference master-reference="main-last"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>

</fo:layout-master-set>
<xsl:for-each select="fattura">
<fo:page-sequence master-reference="sintetica">
<xsl:call-template name="main-document.header"/>
<xsl:call-template name="main-document.footer"/>
<xsl:call-template name="main-document.body"/>
<xsl:call-template name="main-document-last.body"/>
</fo:page-sequence>
</xsl:for-each>

<!--


-->
</fo:root>
</xsl:template>
but i have an error i think in the

Any idea to solve my problem?if i use in the page sequence the flow tag can i declare 2 body?

Thanks!!
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: different body on last page

Post by sorin_ristache »

Hello,

You did not specify the error that is reported by the PDF transformation. Do you have an XML file which you want to transform to FO first and generate a PDF result from the FO file?

What do you mean by "different body section"? Do you want to have a distinct fo:block element in which you set a different style and which includes only the content that will be on the last page of the PDF result? Can you highlight in the FO code in your example above where that content is generated? In your example it is not visible which is that content that will go on the last page and which you want to style in a different way.


Regards,
Sorin
Post Reply