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 Michael Niemann <xm...@yahoo.com> on 2007/11/13 16:44:31 UTC

How to keep pagenumber over several page-sequences

hello,
I've split up my document into several page-sequences for better performance.

<xsl:for-each select="documentContent/chapter">
        <fo:page-sequence master-reference="ContentPageMaster" initial-page-number="1" force-page-count="no-force">
          <fo:static-content flow-name="xsl-region-after">
            <fo:block><fo:page-number /></fo:block> 
          </fo:static-content>
          <fo:flow flow-name="xsl-region-body" >                    
            <fo:block font-size="24" font-weight="bold" border-bottom="solid black 1px" id="{generate-id()}" margin-bottom="20px"><xsl:value-of select="@page" /></fo:block>
            <fo:block><xsl:apply-templates /></fo:block>
          </fo:flow>          
        </fo:page-sequence>
      </xsl:for-each>
    </fo:root>
  </xsl:template>

As you can easily see each chapter now starts with page 1. Is it possible to pass the pagenumber between those sequences without losing all the performance gain I got from spolitting up the chapter into sequences?

best regards
michael

       
---------------------------------
Get easy, one-click access to your favorites.  Make Yahoo! your homepage.

Re: How to keep pagenumber over several page-sequences

Posted by Chris Bowditch <bo...@hotmail.com>.
Michael Niemann wrote:

> hello,
> I've split up my document into several page-sequences for better 
> performance.
> 
> <xsl:for-each select="documentContent/chapter">
>         <fo:page-sequence master-reference="ContentPageMaster" 
> initial-page-number="1" force-page-count="no-force">
>           <fo:static-content flow-name="xsl-region-after">
>             <fo:block><fo:page-number /></fo:block>
>           </fo:static-content>
>           <fo:flow flow-name="xsl-region-body" >                   
>             <fo:block font-size="24" font-weight="bold" 
> border-bottom="solid black 1px" id="{generate-id()}" 
> margin-bottom="20px"><xsl:value-of select="@page" /></fo:block>
>             <fo:block><xsl:apply-templates /></fo:block>
>           </fo:flow>         
>         </fo:page-sequence>
>       </xsl:for-each>
>     </fo:root>
>   </xsl:template>
> 
> As you can easily see each chapter now starts with page 1. Is it 
> possible to pass the pagenumber between those sequences without losing 
> all the performance gain I got from spolitting up the chapter into 
> sequences?

Don't set initial-page-number="1" on any page-sequence except the first. 
To do this you will need to introduce an xsl:if. Try something like the 
following (caveat: completely untested and provided with no warranty!)

<xsl:for-each select="documentContent/chapter">
         <fo:page-sequence master-reference="ContentPageMaster" 
force-page-count="no-force">
		<xsl:if test="position()==1">
			<xsl:attribute name="initial-page-number">1</xsl:attribute>
		</xsl:if>
            <fo:static-content flow-name="xsl-region-after">
              <fo:block><fo:page-number /></fo:block>

etc

Chris



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


RE: How to keep pagenumber over several page-sequences

Posted by MichaelNie <xm...@yahoo.com>.
thanks. chris already posted the solution to my noobish problem. the chapters
are generated through the same sequence template so I just had to insert the
initial value during the first iteration.


Puppala, Kumar (LNG-CON) wrote:
> 
> Let me try to understand your requirement. You have the following
> page-sequences in your document
> 
>  
> 
> Page sequence for Index
> 
> Page sequence for Chapter1
> 
> Page sequence for Chapter2
> 
> .......
> 
>  
> 
> And you want the page number to start off from 1 on Chapter 1 instead of
> Index.
> 
>  
> 
> If this is what you want, you can set initial-page-number on the page
> sequence for Chapter1 to 1 and then not mention this attribute on the
> remaining page-sequences. Regarding page sequence for Index, you mention
> the initial-page-number to 1 as well. The page number gets reset
> whenever you mention the initial-page-number property on a particular
> sequence.
> 
>  
> 
> Hope this helps.
> 
>  
> 
>  
> 
> ________________________________
> 
> From: Michael Niemann [mailto:xml.transformator@yahoo.com] 
> Sent: Wednesday, November 14, 2007 4:09 AM
> To: fop-users@xmlgraphics.apache.org
> Subject: RE: How to keep pagenumber over several page-sequences
> 
>  
> 
> That makes sense. By removing the initial pagenumber for the chapter
> block the count starts with the index page though. How can I make it
> start with 1 without setting it in the block?
> 
> "Puppala, Kumar (LNG-CON)" <ku...@lexisnexis.com> wrote:
> 
> Having just the force-page-count property on the subsequent page
> sequences should do the trick.
> 
>  
> 
> <fo:page-sequence master-reference="ContentPageMaster"
> force-page-count="no-force">
> 
>  
> 
> The page number on subsequent page sequences is a continuation from the
> previous page sequence in this case.
> 
>  
> 
> ________________________________
> 
>   
> 
> ________________________________
> 
> Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See
> how. <http://us.rd.yahoo.com/evt=51732/*http:/overview.mail.yahoo.com/> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-keep-pagenumber-over-several-page-sequences-tf4799039.html#a13748535
Sent from the FOP - Users mailing list archive at Nabble.com.


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


RE: How to keep pagenumber over several page-sequences

Posted by "Puppala, Kumar (LNG-CON)" <ku...@lexisnexis.com>.
Let me try to understand your requirement. You have the following
page-sequences in your document

 

Page sequence for Index

Page sequence for Chapter1

Page sequence for Chapter2

.......

 

And you want the page number to start off from 1 on Chapter 1 instead of
Index.

 

If this is what you want, you can set initial-page-number on the page
sequence for Chapter1 to 1 and then not mention this attribute on the
remaining page-sequences. Regarding page sequence for Index, you mention
the initial-page-number to 1 as well. The page number gets reset
whenever you mention the initial-page-number property on a particular
sequence.

 

Hope this helps.

 

 

________________________________

From: Michael Niemann [mailto:xml.transformator@yahoo.com] 
Sent: Wednesday, November 14, 2007 4:09 AM
To: fop-users@xmlgraphics.apache.org
Subject: RE: How to keep pagenumber over several page-sequences

 

That makes sense. By removing the initial pagenumber for the chapter
block the count starts with the index page though. How can I make it
start with 1 without setting it in the block?

"Puppala, Kumar (LNG-CON)" <ku...@lexisnexis.com> wrote:

Having just the force-page-count property on the subsequent page
sequences should do the trick.

 

<fo:page-sequence master-reference="ContentPageMaster"
force-page-count="no-force">

 

The page number on subsequent page sequences is a continuation from the
previous page sequence in this case.

 

________________________________

  

________________________________

Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See
how. <http://us.rd.yahoo.com/evt=51732/*http:/overview.mail.yahoo.com/> 


RE: How to keep pagenumber over several page-sequences

Posted by Michael Niemann <xm...@yahoo.com>.
That makes sense. By removing the initial pagenumber for the chapter block the count starts with the index page though. How can I make it start with 1 without setting it in the block?

"Puppala, Kumar (LNG-CON)" <ku...@lexisnexis.com> wrote:        v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);}           Having just the force-page-count property on the subsequent page sequences should do the trick.
   
  <fo:page-sequence master-reference="ContentPageMaster" force-page-count="no-force">
   
  The page number on subsequent page sequences is a continuation from the previous page sequence in this case.
   
      
---------------------------------
  



       
---------------------------------
Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.

RE: How to keep pagenumber over several page-sequences

Posted by "Puppala, Kumar (LNG-CON)" <ku...@lexisnexis.com>.
Having just the force-page-count property on the subsequent page
sequences should do the trick.

 

<fo:page-sequence master-reference="ContentPageMaster"
force-page-count="no-force">

 

The page number on subsequent page sequences is a continuation from the
previous page sequence in this case.

 

________________________________

From: Michael Niemann [mailto:xml.transformator@yahoo.com] 
Sent: Tuesday, November 13, 2007 10:45 AM
To: fop-users@xmlgraphics.apache.org
Subject: How to keep pagenumber over several page-sequences

 

hello,
I've split up my document into several page-sequences for better
performance.

<xsl:for-each select="documentContent/chapter">
        <fo:page-sequence master-reference="ContentPageMaster"
initial-page-number="1" force-page-count="no-force">
          <fo:static-content flow-name="xsl-region-after">
            <fo:block><fo:page-number /></fo:block> 
          </fo:static-content>
          <fo:flow flow-name="xsl-region-body" >                    
            <fo:block font-size="24" font-weight="bold"
border-bottom="solid black 1px" id="{generate-id()}"
margin-bottom="20px"><xsl:value-of select="@page" /></fo:block>
            <fo:block><xsl:apply-templates /></fo:block>
          </fo:flow>          
        </fo:page-sequence>
      </xsl:for-each>
    </fo:root>
  </xsl:template>

As you can easily see each chapter now starts with page 1. Is it
possible to pass the pagenumber between those sequences without losing
all the performance gain I got from spolitting up the chapter into
sequences?

best regards
michael

  

________________________________

Get easy, one-click access to your favorites. Make Yahoo! your homepage.
<http://us.rd.yahoo.com/evt=51443/*http:/www.yahoo.com/r/hs>