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

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger



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



Reply via email to