FOP, Help fo:page-number
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
-
- Posts: 1
- Joined: Mon Sep 19, 2016 4:46 pm
Re: FOP, Help fo:page-number
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)
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
and later in insertBody tamplate
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
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>
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>
I use DITA OT 2.2 and DITA 1.3 version
Regards
-
- Posts: 53
- Joined: Wed Mar 27, 2019 10:12 am
Re: FOP, Help fo:page-number
Post 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.
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.
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
-
- Posts: 53
- Joined: Wed Mar 27, 2019 10:12 am
Re: FOP, Help fo:page-number
Post 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.
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.
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: FOP, Help fo:page-number
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
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
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
-
- Posts: 53
- Joined: Wed Mar 27, 2019 10:12 am
Re: FOP, Help fo:page-number
Post 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.
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.
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: FOP, Help fo:page-number
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
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
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service