FOP, Help fo:page-number

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

FOP, Help fo:page-number

Thu Feb 17, 2005 5:44 pm


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.
Posts: 4144

Fri Feb 18, 2005 5:32 pm


This is a FAQ. See

Posts: 1

Re: FOP, Help fo:page-number

Mon Sep 19, 2016 5:09 pm


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:when test="/*[contains(@class, ' bookmap/bookmap ')]">
                    <xsl:value-of select="'even'"/>
                    [b]<xsl:value-of select="'end-on-even'"/>[/b]

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"/>
               <xsl:apply-templates select="$fo/*" mode="postprocess"/>   
   <xsl:template match="fo:flow[not(following::fo:flow)]" mode="postprocess">
            <xsl:copy-of select="@*"/>
            <xsl:apply-templates mode="postprocess"/>
            <fo:block id="last-page-id" keep-with-previous.within-page="always"/>

and later in insertBody tamplate

Code: Select all

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

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


Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest