cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Katrin_Seiff...@mn.man.de
Subject Re: fop: page numbers are not reset
Date Mon, 06 Nov 2000 11:03:30 GMT

I hope it help you:

<xsl:template match="page">
     <xsl:processing-instruction name="cocoon-format">type
="text/xslfo"</xsl:processing-instruction>
     <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
          <fo:layout-master-set>
          ...
          </fo:layout-master-set>

          <fo:page-sequence master-name="example" initial-page-number="1" >
<!-- HERE THE initial-page-number TAG-->
               <fo:sequence-specification>
               ...
               </fo:sequence-specification>

               <fo:static-content flow-name="xsl-after">
               <!-- HERE THE PAGE NUMPER-->
               </fo:static-content>

               <fo:flow>
               ...
               </fo:flow>
          </fo:page-sequence>
     </fo:root>
</xsl:template>


Katrin Seiffert



                                                                                         
                         
                    Davor Cengija                                                        
                         
                    <dcengija@mcs        An:     cocoon-users@xml.apache.org          
                            
                    .hr>                 Kopie:                                       
                            
                                         Thema:  fop: page numbers are not reset         
                         
                    06.11.00                                                             
                         
                    09:25                                                                
                         
                    Bitte                                                                
                         
                    antworten an                                                         
                         
                    cocoon-users                                                         
                         
                                                                                         
                         
                                                                                         
                         




           Cocoon 1.8, but if I remember correctly, the same problem was
           with 1.7.4.

           I have an XSL file which converts Bosak's Shakespeare's dramas
           to PDF, and at the bottom of each page I have a page number
           displayed. It displays correct numbers only in the first
           generated PDF, and in any other it just continues from where
           it ended in the previous PDF. E.g. If Hamlet PDF is 130 pages
           long, King Lear's first page would be numbered as 131 etc.

           It could be that I messed something with XSL (which is still
           very new technology to me), but I just copied it from the
           examples and adjusted a little. Here it is (only the first
           template, '/'):

  <xsl:template match="/">
    <xsl:processing-instruction name="cocoon-format">type
="text/xslfo"</xsl:processing-instruction>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <fo:layout-master-set>
      <fo:simple-page-master
        page-master-name="right"
        margin-top="75pt"
        margin-bottom="25pt"
        margin-left="100pt"
        margin-right="50pt">
        <fo:region-body margin-bottom="50pt"/>
        <fo:region-after extent="25pt"/>
      </fo:simple-page-master>
      <fo:simple-page-master
        page-master-name="left"
        margin-top="75pt"
        margin-bottom="25pt"
        margin-left="50pt"
        margin-right="100pt">
        <fo:region-body margin-bottom="50pt"/>
        <fo:region-after extent="25pt"/>
      </fo:simple-page-master>
      </fo:layout-master-set>

      <fo:page-sequence>

        <fo:sequence-specification>
          <fo:sequence-specifier-alternating
            page-master-first="right"
            page-master-odd="right"
            page-master-even="left"/>
        </fo:sequence-specification>

        <fo:static-content flow-name="xsl-after">

           <!-- HERE'S THE PAGE NUMBER -->
          <fo:block text-align-last="centered" font-size
="10pt"><xsl:value-of select="/PLAY/PLAYSUBT"/> by William Shakespeare - p.
<fo:page-number/></fo:block>
        </fo:static-content>

        <fo:flow>
          <xsl:apply-templates/>
        </fo:flow>
      </fo:page-sequence>

    </fo:root>
  </xsl:template>

           Thanks.

           P.S. Is there support for fop 0.14?

--
      v
Davor Cengija
dcengija@mcs.hr
===========================
"Nicht mit Alkohol mischen"


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org






Mime
View raw message