FOP, Help fo:page-number

Here should go questions about transforming XML with XSLT and FOP.
fabiofop
Posts: 3

FOP, Help fo:page-number

Thu Feb 17, 2005 5:44 pm

Hi,

i want display this:

page - number / number of pages
e.g. 1/20

Is it possible by tag
<fo:page-number ?

Thanks & thanks
for any suggestion.
fabio
sorin_ristache
Posts: 4144

Fri Feb 18, 2005 5:32 pm

Hello,

This is a FAQ. See

http://xml.apache.org/fop/faq.html#fo-total-pages

Regards,
Sorin
matchey_m
Posts: 1

Re: FOP, Help fo:page-number

Mon Sep 19, 2016 5:09 pm

Hello,

It is my first post here, so I would like to say hello to everyone and thank for your future help :)
Well, I am looking for a information where should I look for mistake, because I think there is a big wall in front of me, and I really do not know what to do.
The problem is connected with page numbering issue, I would like to publish PDF files always with even number of pages.
I forced this feature in file common-attr.xsl (bolded line)

Code: Select all

 <xsl:attribute-set name="__force__page__count">
        <xsl:attribute name="force-page-count">
            <xsl:choose>
                <xsl:when test="/*[contains(@class, ' bookmap/bookmap ')]">
                    <xsl:value-of select="'even'"/>
                </xsl:when>
                <xsl:otherwise>
                    [b]<xsl:value-of select="'end-on-even'"/>[/b]
                </xsl:otherwise>
            </xsl:choose>
        </xsl:attribute>
    </xsl:attribute-set>


Then, last page is not taken into counting and the caption looks like that i.e. "12 / 11" [current page / total pages]
If I switch it back to auto mode, I can get proper values of page numbers.


Here are parts of code from custom.xsl file

Code: Select all

<xsl:template match="/" name="rootTemplate">
           <xsl:call-template name="validateTopicRefs"/>
         <xsl:variable name="fo">
                 <fo:root xsl:use-attribute-sets="__fo__root">
                        <xsl:call-template name="createMetadata"/>
                        <xsl:call-template name="createLayoutMasters"/>
                        <xsl:call-template name="createBookmarks"/>
                       <xsl:apply-templates select="*" mode="generatePageSequences"/>
                 </fo:root>
         </xsl:variable>
               <xsl:apply-templates select="$fo/*" mode="postprocess"/>   
      </xsl:template>
   
   <xsl:template match="fo:flow[not(following::fo:flow)]" mode="postprocess">
         <xsl:copy>
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates mode="postprocess"/>
            <fo:block id="last-page-id" keep-with-previous.within-page="always"/>
         </xsl:copy>
   </xsl:template>



and later in insertBody tamplate

Code: Select all

      
      <totalpages>
         <fo:page-number-citation-last page-citation-strategy="all" ref-id="last-page-id" />
      </totalpages>
      


Where I should look for solving this issue? I would be very greatful for your help

I use DITA OT 2.2 and DITA 1.3 version

Regards

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 2 guests