Page 1 of 1

FOP, Help fo:page-number

Posted: Thu Feb 17, 2005 5:44 pm
by fabiofop
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

Posted: Fri Feb 18, 2005 5:32 pm
by sorin_ristache
Hello,

This is a FAQ. See

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

Regards,
Sorin

Re: FOP, Help fo:page-number

Posted: Mon Sep 19, 2016 5:09 pm
by matchey_m
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

Re: FOP, Help fo:page-number

Posted: Fri Nov 15, 2019 12:51 pm
by Manohar_1024
Hello,

I actually want same output like pagenumber 1/20 (total number of pages per chapter).
But i am using DITA with CSS transformation.
So please help me achieving this.

Thank you,
Manohar.

Re: FOP, Help fo:page-number

Posted: Tue Nov 19, 2019 2:39 pm
by Dan
For CSS please read:
https://www.oxygenxml.com/doc/versions/ ... aid-title5
Many regards,
Dan

Re: FOP, Help fo:page-number

Posted: Wed Nov 20, 2019 10:32 am
by Manohar_1024
Hello Dan,

I have read and tried using css that you have suggested. but it is taking number of pages in first chapter as default.
For example :
in chapter 1 : footer- page 2 of 4
in chapter 2: footer- page 2 of 4.
Please help in getting this chapter wise.

Thank you,
Manohar.

Re: FOP, Help fo:page-number

Posted: Wed Nov 20, 2019 12:00 pm
by Costin
Manohar,

Just edit the CSS-based transformation scenario that you are using to obtain the PDF and, in the "Parameters" tab of the scenario editing dialog, look for the "args.css.param.numbering".
Set that parameter's value to "deep-chapter-scope-no-page-reset" and the page numbering should be continuous from the very beginning of the PDF document and all the way down to the end.

You can find more information on the various page numbering variants in the Numbering Types section from the DCPP User-Guide on our website.

Regards,
Costin

Re: FOP, Help fo:page-number

Posted: Tue Nov 26, 2019 10:13 am
by Manohar_1024
Thanks costin,

But i want both chapterwise page numbering i.e., Page numbers should get reset for chapter and want 1/ Total number of pages for a chapter in the footer.
I am using DITA with CSS transformation.

Thank you,
Manohar.

Re: FOP, Help fo:page-number

Posted: Mon Dec 02, 2019 5:03 pm
by Costin
Hi,

I'm afraid that is not something that could be done.
It is not possible to have contextual counters for current page and for the total pages in each chapter.

Regards,
Costin