Why is my guide using first and last page layouts, not odd?

taz-man
Posts: 3

Why is my guide using first and last page layouts, not odd?

Wed Feb 14, 2018 9:15 pm

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.
radu_pisoi
Posts: 334
Location: Craiova

Re: Why is my guide using first and last page layouts, not odd?

Mon Feb 19, 2018 1:09 pm

Hi,

taz-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 ;-)


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 attribute

Code: Select all

<xsl:attribute-set name="__force__page__count">
  <xsl:attribute name="force-page-count">auto</xsl:attribute>       
</xsl:attribute-set>

In my test, I used oXygen 19.1 and DITA-OT 2.5.2 that comes bundled with oXygen.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
taz-man
Posts: 3

Re: Why is my guide using first and last page layouts, not odd?

Thu Mar 15, 2018 10:23 pm

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!

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 0 guests