Kuba Królikowski wrote:
Dnia 2003-10-09 15:30, Użytkownik Chris Bowditch napisał:

From: Kuba Królikowski <[EMAIL PROTECTED]>


As Chris advised, it's best to use a different page-master for this.


Thanx for advise but I'm afraid that it is not a solution to my problem. I want to print (render) a very long table, I don't know how many pages it will take up and I don't know where there will be page breaks. If my understanding is fine I can use only one page-master for this table. Am I right? How then I could print different informations on different pages (for example in static-content, region-before)?



No, you dont need to know where page-breaks will occur in your table, FOP will take care of it for you. You just create a simple-page-master for odd pages and one for even, Hopefully the following example will get you started;


<fo:root>
<fo:page-layout-set>
<fo:simple-page-master master-name="masterodd">
<fo:region-body margin-top="2cm"/>
<fo:region-before region-name="before-odd" extent="2cm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="mastereven">
<fo:region-body margin-top="2cm"/>
<fo:region-before region-name="before-even" extent="2cm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="oddEven">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference odd-or-even="odd" master-reference="masterodd"/>
<fo:conditional-page-master-reference odd-or-even="even" master-reference="mastereven"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:page-layout-set>


this defines a different page-master for odd and even pages, then to put different content on each, define two static-contents in the page-sequence, e.g.

<fo:page-sequence>
<fo:static-content flow-name="before-odd">
<fo:block>This is an odd page</fo:block>
</fo:static-content>
<fo:static-content flow-name="before-even">
<fo:block>This is an even page</fo:block>
</fo:static-content>

Then put the contents of the body into fo:flow as usual. Beware; that I have not tested this code on FOP. Specifically I cant recall if FOP allows references to named regions in the flow-name attribute. This works in XEP, and theres nothing on the FOP compliance page to suggest otherwise.

Chris


Ok, I understand. But it isn't a complete solution on my problem still. I know now how do print something different on pages no. k where k modulo 2 = 0 and k modulo 2 = 1. Don't you think that this is very unflexible? What should I do when I want to print something in static content ONLY on page no 1, or only on second page, or only on pages 5,10,15,20,...(k modulo 5 = 0), or only on last page etc.?


Kuba Królikowski

Hello,

I found some time ago the following links which might help you.

http://www.dpawson.co.uk/xsl/sect2/N7450.html#d4e82 http://www.dpawson.co.uk/xsl/sect2/N6280.html#d6777e235 http://www.dpawson.co.uk/xsl/sect2/N7450.html#d4e484

In short: Try a statement like
"<xsl:when test="position() mod 5 = 1">background-color:gray; </xsl:when>".

Caution: I never tried it by me self !

Matthias Schäfer



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to