Why is my guide using first and last page layouts, not odd?
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 3
- Joined: Fri Feb 09, 2018 10:07 pm
Why is my guide using first and last page layouts, not odd?
I'm using Oxygen 19.1 and have two projects that build PDFs using a customized, PDF2 DITA Map PDF transform scenario from a bookmap. I believe I want all of the PDFs generated in each project to use a customized "first" at the start of a chapter and "odd" body or "odd" TOC pages (there's no index or preface). My customization layout works in both projects. Each transform using the parameter args.chapter.layout setting of "BASIC".
PROBLEM I can't solve: Each project uses odd body and TOC page layouts consistently and correctly (page numbering is both odd and even), while the "first" page only works on odd page numbers. For even-numbered pages at the beginning of chapters in one project, there's no header or footer on the first page of a chapter, while in the second project, the page uses an odd body page layout. I played around with configuring even page layouts but they only appear when I set <xsl:variable name="mirror-page-margins" select="true()"/> and in this case, the even-odd pages work as you'd expect.
I am using this folder architecture:
C:DITA-files-customization (contains our customization files like catalog.xml, common\vars\en.xml, and fo\attrs\custom.xsl)
C:DITA-files-project1
C:DITA-files-project2
I force the page layout like this in customization\fo\attrs\custom.xsl:
<xsl:attribute-set name="__force__page__count">
<xsl:attribute name="force-page-count">
<xsl:choose>
<xsl:when test="name(/*) = 'bookmap'">
<xsl:value-of select="'no-force'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'no-force'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:attribute-set>
I found this setting online but don't know if it's correct.
But I get the same results with this alternative approach (https://github.com/oxygenxml/com.oxygen ... s-attr.xsl) that prevents chapters from starting on an odd page:
<xsl:attribute-set name="__force__page__count">
<xsl:attribute name="force-page-count">auto</xsl:attribute>
</xsl:attribute-set>
I am missing how to overcome the logic that printed books shouldn't start on an even page but it's ok in my customization for a chapter to start on either even or odd page number. boohoohoo
I'd appreciate any thoughts or comments.
PROBLEM I can't solve: Each project uses odd body and TOC page layouts consistently and correctly (page numbering is both odd and even), while the "first" page only works on odd page numbers. For even-numbered pages at the beginning of chapters in one project, there's no header or footer on the first page of a chapter, while in the second project, the page uses an odd body page layout. I played around with configuring even page layouts but they only appear when I set <xsl:variable name="mirror-page-margins" select="true()"/> and in this case, the even-odd pages work as you'd expect.
I am using this folder architecture:
C:DITA-files-customization (contains our customization files like catalog.xml, common\vars\en.xml, and fo\attrs\custom.xsl)
C:DITA-files-project1
C:DITA-files-project2
I force the page layout like this in customization\fo\attrs\custom.xsl:
<xsl:attribute-set name="__force__page__count">
<xsl:attribute name="force-page-count">
<xsl:choose>
<xsl:when test="name(/*) = 'bookmap'">
<xsl:value-of select="'no-force'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'no-force'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:attribute-set>
I found this setting online but don't know if it's correct.
But I get the same results with this alternative approach (https://github.com/oxygenxml/com.oxygen ... s-attr.xsl) that prevents chapters from starting on an odd page:
<xsl:attribute-set name="__force__page__count">
<xsl:attribute name="force-page-count">auto</xsl:attribute>
</xsl:attribute-set>
I am missing how to overcome the logic that printed books shouldn't start on an even page but it's ok in my customization for a chapter to start on either even or odd page number. boohoohoo

I'd appreciate any thoughts or comments.
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Why is my guide using first and last page layouts, not odd?
Post by radu_pisoi »
Hi,
In my test, I used oXygen 19.1 and DITA-OT 2.5.2 that comes bundled with oXygen.
I've tested with force-page-count="auto" approach and I get continuous numbering in the generated PDF file. I've tried with a bookmap and a clean PDF customization that specifies only the force-page-count attributetaz-man wrote: I am missing how to overcome the logic that printed books shouldn't start on an even page but it's ok in my customization for a chapter to start on either even or odd page number. boohoohoo![]()
Code: Select all
<xsl:attribute-set name="__force__page__count">
<xsl:attribute name="force-page-count">auto</xsl:attribute>
</xsl:attribute-set>
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Fri Feb 09, 2018 10:07 pm
Re: Why is my guide using first and last page layouts, not odd?
Thanks for confirming this. Did you have to make other changes to get this layout?
So I still have the problem: no page numbers on first pages when it's an even-numbered page in the chapter. The only way I have been able to get continuous numbers is to change this when I change this default setting in lines 244-248 in the file \frameworks\dita\DITA-OT2.x\plugins\org.dita.pdf2\cfg\fo\layout-masters.xsl:
<fo:repeatable-page-master-alternatives>
<xsl:if test="$first">
<fo:conditional-page-master-reference master-reference="{$master-reference}-first"
odd-or-even="odd"
page-position="first"/>
to be:
<fo:repeatable-page-master-alternatives>
<xsl:if test="$first">
<fo:conditional-page-master-reference master-reference="{$master-reference}-first"
odd-or-even="auto"
page-position="first"/>
But this generates an error in the transform: Invalid property value encountered in odd-or-even="auto": org.apache.fop.fo.expr.PropertyException: file:/C:/Users/aciut/temp/pdf/oxygen_dita_temp/topic.fo:1:7336: No conversion defined auto; property:'odd-or-even' (See position 1:7447).
If this works, 2 questions arise: how can I define auto for this value? How can I make this customization in my custom.xsl file, not in this standard pdf2 plugin file? The other obvious question is why would the default skip evens? it doesn't make sense...perhaps something is wrong in my custom master-layoutmasters-attr.xsl file?
Cheers and thank you!
So I still have the problem: no page numbers on first pages when it's an even-numbered page in the chapter. The only way I have been able to get continuous numbers is to change this when I change this default setting in lines 244-248 in the file \frameworks\dita\DITA-OT2.x\plugins\org.dita.pdf2\cfg\fo\layout-masters.xsl:
<fo:repeatable-page-master-alternatives>
<xsl:if test="$first">
<fo:conditional-page-master-reference master-reference="{$master-reference}-first"
odd-or-even="odd"
page-position="first"/>
to be:
<fo:repeatable-page-master-alternatives>
<xsl:if test="$first">
<fo:conditional-page-master-reference master-reference="{$master-reference}-first"
odd-or-even="auto"
page-position="first"/>
But this generates an error in the transform: Invalid property value encountered in odd-or-even="auto": org.apache.fop.fo.expr.PropertyException: file:/C:/Users/aciut/temp/pdf/oxygen_dita_temp/topic.fo:1:7336: No conversion defined auto; property:'odd-or-even' (See position 1:7447).
If this works, 2 questions arise: how can I define auto for this value? How can I make this customization in my custom.xsl file, not in this standard pdf2 plugin file? The other obvious question is why would the default skip evens? it doesn't make sense...perhaps something is wrong in my custom master-layoutmasters-attr.xsl file?
Cheers and thank you!
Return to “DITA (Editing and Publishing DITA Content)”
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