You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by MARTIN Franck <fr...@c-s.fr> on 2002/10/08 16:55:13 UTC

Re: Static-content on even pages only and bug in FOP!!!

Thanks for you reply

That is not working either but it helps a bit. The even-body static-content that is "Some static content that fits on one page but that must be repeated on every even page only" is still not displayed at all. Moreover the last page which is even (that is due to force-page-count="even") displays the page-odd-before content and not the even one!!!

So there seems to be a bug in fop cause the last page which is even numbered should have the even page master not the odd one!!!

has anyone had this experiment before??

franck MARTIN
  ----- Original Message ----- 
  From: Matthew L. Avizinis 
  To: fop-user@xml.apache.org 
  Sent: Tuesday, October 08, 2002 4:23 PM
  Subject: RE: Static-content on even pages only


  To do what you want you need some additional stuff.  Basically you have to add a region-before to each simple-page-master and name those regions.  Then you have to have a static content which references those new region names.  Refer below

        <?xml version="1.0" encoding="ISO-8859-1"?>
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
        <fo:layout-master-set>
            <fo:simple-page-master master-name="odd-page">
                 <fo:region-body region-name="global-region-body"/>
        [2¢]-->] <fo:region-before region-name="page-odd" extent="25mm"/>
            </fo:simple-page-master>

            <fo:simple-page-master master-name="even-page">
                <fo:region-body region-name="even-region-body"/>
        [2¢]-->] <fo:region-before region-name="page-even" extent="25mm"/> 
            </fo:simple-page-master>

            <fo:page-sequence-master master-name="page-sequence-global">
                <fo:repeatable-page-master-alternatives>
                      <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd-page"/>
                      <fo:conditional-page-master-reference odd-or-even="even" master-reference="even-page"/>
                </fo:repeatable-page-master-alternatives>
            </fo:page-sequence-master>
        </fo:layout-master-set>

        <fo:page-sequence master-reference="page-sequence-global" initial-page-number="1" force-page-count="even">
            <fo:static-content flow-name="even-region-body">
                <fo:block>Some static content that fits on one page but that must be repeated on every even page only</fo:block>
            </fo:static-content>
        [2¢]-->] <fo:static-content flow-name="page-odd">
                      your content
                   </fo:flow> 
        [2¢]-->] <fo:static-content flow-name="page-even">
                      your content
                    </fo:flow> 

          
           <fo:flow flow-name="global-region-body">
                <fo:block>Some very long flow that could fit on more than one page</fo:block>
            </fo:flow>
        </fo:page-sequence>
        </fo:root> 

        Thanks alot

        Franck MARTIN


RE: Static-content on even pages only and bug in FOP!!!

Posted by "Matthew L. Avizinis" <ml...@gleim.com>.
Here's a setup that I know puts even and odd static content on even and odd
pages, because it's the one I use on a regular basis.  Maybe by example you
can figure out what you require.

<fo:layout-master-set>
   <fo:simple-page-master master-name="first-page" page-height="279mm"
page-width="216mm">
      <fo:region-body margin-top="12.0mm" margin-bottom="5mm"
margin-left="19.1mm" margin-right="19.1mm"/>
      <fo:region-before region-name="page-num-only" extent="27.9mm"/>
      <fo:region-after extent="10.0mm"/>
   </fo:simple-page-master>

   <fo:simple-page-master master-name="page-odd" page-height="279mm"
page-width="216mm">
      <fo:region-body margin-top="12.0mm" margin-bottom="5mm"
margin-left="19.1mm" margin-right="19.1mm"/>
      <fo:region-before region-name="page-num-right" extent="27.9mm"/>
      <fo:region-after extent="10.0mm"/>
   </fo:simple-page-master>

   <fo:simple-page-master master-name="page-even" page-height="279mm"
page-width="216mm">
      <fo:region-body margin-top="12.0mm" margin-bottom="5mm"
margin-left="19.1mm" margin-right="19.1mm"/>
      <fo:region-before region-name="page-num-left" extent="27.9mm"/>
      <fo:region-after extent="10.0mm"/>
   </fo:simple-page-master>

   <fo:page-sequence-master master-name="outline">
      <fo:repeatable-page-master-reference master-reference="first-page"
maximum-repeats="1"/>
      <fo:repeatable-page-master-alternatives maximum-repeats="no-limit">
         <fo:conditional-page-master-reference odd-or-even="odd"
master-reference="page-odd"/>
         <fo:conditional-page-master-reference odd-or-even="even"
master-reference="page-even"/>
      </fo:repeatable-page-master-alternatives>
   </fo:page-sequence-master>
</fo:layout-master-set>


<fo:page-sequence master-reference="outline" initial-page-number="1"
format="1" font-family="Helvetica">
   <fo:static-content flow-name="page-num-only">
   </fo:static-content>


   <fo:static-content flow-name="page-num-left">
   </fo:static-content>

   <fo:static-content flow-name="page-num-right">
   </fo:static-content>


-----Original Message-----
From: MARTIN Franck [mailto:franck.martin@c-s.fr]
Sent: Tuesday, October 08, 2002 10:55 AM
To: fop-user@xml.apache.org
Subject: Re: Static-content on even pages only and bug in FOP!!!


Thanks for you reply

That is not working either but it helps a bit. The even-body static-content
that is "Some static content that fits on one page but that must be repeated
on every even page only" is still not displayed at all. Moreover the last
page which is even (that is due to force-page-count="even") displays the
page-odd-before content and not the even one!!!

So there seems to be a bug in fop cause the last page which is even numbered
should have the even page master not the odd one!!!

has anyone had this experiment before??

franck MARTIN
----- Original Message -----
From: Matthew L. Avizinis
To: fop-user@xml.apache.org
Sent: Tuesday, October 08, 2002 4:23 PM
Subject: RE: Static-content on even pages only


To do what you want you need some additional stuff.  Basically you have to
add a region-before to each simple-page-master and name those regions.  Then
you have to have a static content which references those new region names.
Refer below

<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
    <fo:simple-page-master master-name="odd-page">
         <fo:region-body region-name="global-region-body"/>
[2¢]-->] <fo:region-before region-name="page-odd" extent="25mm"/>
    </fo:simple-page-master>

    <fo:simple-page-master master-name="even-page">
        <fo:region-body region-name="even-region-body"/>
[2¢]-->] <fo:region-before region-name="page-even" extent="25mm"/>
    </fo:simple-page-master>

    <fo:page-sequence-master master-name="page-sequence-global">
        <fo:repeatable-page-master-alternatives>
              <fo:conditional-page-master-reference odd-or-even="odd"
master-reference="odd-page"/>
              <fo:conditional-page-master-reference odd-or-even="even"
master-reference="even-page"/>
        </fo:repeatable-page-master-alternatives>
    </fo:page-sequence-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="page-sequence-global"
initial-page-number="1" force-page-count="even">
    <fo:static-content flow-name="even-region-body">
        <fo:block>Some static content that fits on one page but that must be
repeated on every even page only</fo:block>
    </fo:static-content>
[2¢]-->] <fo:static-content flow-name="page-odd">
              your content
           </fo:flow>
[2¢]-->] <fo:static-content flow-name="page-even">
              your content
            </fo:flow>


   <fo:flow flow-name="global-region-body">
        <fo:block>Some very long flow that could fit on more than one
page</fo:block>
    </fo:flow>
</fo:page-sequence>
</fo:root>

Thanks alot

Franck MARTIN