W3C home > Mailing lists > Public > www-xsl-fo@w3.org > March 2003

Re: Double side document with legal information on the back

From: <Klaas_Bals@inventivedesigners.com>
Date: Wed, 12 Mar 2003 21:44:32 +0100
To: "Steve GF Cornet" <steve_cornet@huntsman.com>
Cc: www-xsl-fo@w3.org
Message-ID: <OFE6031A9D.7276419A-ONC1256CE7.007160EA-41256CE7.0071F100@INVENTIVEDESIGNERS.COM>


I've got a working XSL-FO document.

Some formatters work well on this document. The way it works is that you
have a conditional page master references for odd and even pages. The
region-body of an even page (that is supposed to contain the legal
information) has a padding-before equal to the page-height. Therefore all
text in the flow will wrap to a next page. The before region of these even
pages will then contain the legal text.

Some formatters don't seem to be able to handle the body region with no
actual space for text. I've also had good results with some formatters when
I renamed the region-body of the 'even' page-master to something else.
However, I'm not sure whether this approach is fully allowed by the XSL-FO
standard. (Anyone?)

Anyway, if this is not exacly what you want, it might show you the
direction...

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
     <fo:layout-master-set>
          <fo:simple-page-master page-width="595.25pt" page-height=
"841.85pt" master-name="odd">
               <fo:region-body region-name="reg-body" margin="3cm" />
               <fo:region-before region-name="reg-before-odd" extent="3cm"
/>
               <fo:region-after region-name="reg-after-odd" extent="3cm" />
               <fo:region-start region-name="reg-start-odd" extent="3cm" />
               <fo:region-end region-name="reg-end-odd" extent="3cm" />
          </fo:simple-page-master>
          <fo:simple-page-master page-width="595.25pt" page-height=
"841.85pt" master-name="even">
               <fo:region-body region-name="reg-body" padding-before=
"841.85pt"/>
               <fo:region-before region-name="reg-before-even" extent=
"100%"/>
          </fo:simple-page-master>
          <fo:page-sequence-master master-name="alternating">
               <fo:repeatable-page-master-alternatives>
                    <fo:conditional-page-master-reference odd-or-even="odd"
master-reference="odd" />
                    <fo:conditional-page-master-reference odd-or-even=
"even" master-reference="even" />
               </fo:repeatable-page-master-alternatives>
          </fo:page-sequence-master>
     </fo:layout-master-set>
     <fo:page-sequence master-reference="alternating">
          <fo:static-content flow-name="reg-before-even">
               <fo:block padding-start="3cm" padding-end="3cm"
padding-before="3cm" padding-after="3cm" margin="0pt">
                    <fo:block color="red">This text should appear on every
even page.</fo:block>
               </fo:block>
          </fo:static-content>
          <fo:flow flow-name="reg-body">
               <fo:block>Test text in flow.</fo:block>
          </fo:flow>
     </fo:page-sequence>
</fo:root>

Feedback VERY welcome :-)
-----
Klaas Bals  -  Scriptura Development Manager

Scriptura - a WYSIWYG XSL-FO editor: www.inventivedesigners.com/scriptura

Inventive Designers
Direct Phone: +32 - 3 - 8210183
Office Phone: +32 - 3 - 8210170
Office Fax: +32 - 3 - 8210171
Email: Klaas_Bals at inventivedesigners dot com






                                                                                                                                                
                    "Steve GF Cornet"                                                                                                           
                    <steve_cornet@hun       To:     www-xsl-fo@w3.org                                                                           
                    tsman.com>              cc:                                                                                                 
                    Sent by:                Subject:     Double side document with legal information on the back                                
                    www-xsl-fo-reques                                                                                                           
                    t@w3.org                                                                                                                    
                                                                                                                                                
                                                                                                                                                
                    11/03/2003 13:56                                                                                                            
                                                                                                                                                





I would like to create a double side document where the "even" page will
always contain some legal information (E.g.: to print an invoice). On my
odd page, I have a header, a footer and a body which contains a table with
several rows. When the number of rows is too high, FOP decide to generate a
break and continue on the next page. My problem is that I would like to
insert my legal information after this break (every "even" page must
contain legal information)...Is there any way to do this in fo or do I need
to handle this in xsl?

My fo document looks like this:


<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
   <fo:layout-master-set>

      <fo:simple-page-master margin-right="0.7cm" margin-left="0.7cm"
margin-bottom="0.5cm"
          margin-top="0.75cm" page-width="21cm" page-height="29.7cm"
master-name="recto">
         <fo:region-before region-name="xsl-region-before" extent
="11.5cm"/>
         <fo:region-body region-name="xsl-region-body" margin-top="11.5cm"
margin-bottom="4cm"/>
         <fo:region-after region-name="xsl-region-after" extent="4cm"/>
      </fo:simple-page-master>

      <fo:simple-page-master margin-right="0.7cm" margin-left="0.7cm"
margin-bottom="0.5cm"
          margin-top="0.75cm" page-width="21cm" page-height="29.7cm"
master-name="verso">
         <fo:region-body/>
      </fo:simple-page-master>

      <fo:page-sequence-master master-name="all-pages">
         <fo:repeatable-page-master-alternatives>
            <fo:conditional-page-master-reference master-reference="recto"
odd-or-even="odd"/>
            <fo:conditional-page-master-reference master-reference="verso"
odd-or-even="even"/>
         </fo:repeatable-page-master-alternatives>
      </fo:page-sequence-master>

   </fo:layout-master-set>


   <fo:page-sequence master-reference="all-pages">

      <fo:static-content text-align="start" font-family="sans-serif"
font-size="8pt" flow-name="xsl-region-before">
      ...
      </fo:static-content>

      <fo:static-content text-align="start" font-family="sans-serif"
font-size="8pt" flow-name="xsl-region-after">
      ...
      </fo:static-content>

      <fo:flow text-align="start" font-family="sans-serif" font-size="8pt"
flow-name="xsl-region-body">

         <fo:table border-top-color="black" border-top-style="solid"
border-top-width=".2mm"
             border-bottom-color="black" border-bottom-style="solid"
border-bottom-width=".2mm"
             table-omit-header-at-break="false" table-omit-footer-at-break
="false" table-layout="fixed">
         ....
         </fo:table>

      </fo:flow>
   </fo:page-sequence>


   <fo:page-sequence master-reference="all-pages">
      <fo:flow text-align="start" font-family="sans-serif" font-size="8pt"
flow-name="xsl-region-body">
      ...
      </fo:flow>
   </fo:page-sequence>

</fo:root>


Thanks
Steve


IMPORTANT NOTICE
This email is confidential, may be legally privileged, and is for the
intended recipient only.  Access, disclosure, copying, distribution, or
reliance on any of it by anyone else is prohibited and may be a criminal
offense.  Please delete if obtained in error and email confirmation to the
sender.

Visit our corporate website at http://www.huntsman.com
Received on Wednesday, 12 March 2003 15:44:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:10 GMT