Using bookmaps and PDF2 transformation: how to enable continuous paging and stop chapters from starting on even page

Exotic Hadron
Posts: 25

Using bookmaps and PDF2 transformation: how to enable continuous paging and stop chapters from starting on even page

Wed Aug 09, 2017 8:58 pm

Howdy,

I've moved my project from DITAMAP to BOOKMAP (thanks to Costin for his detailed explanation on how to achieve that). And I have found that when using PDF2 transformation, Oxygen/DITA forces the first page of every new chapter to start on the even page. While this is a common practice for printed books, I don't wan't this for my electronic PDF manual; because it's unlikely that somebody would print it on paper.

How would I enable Oxygen/DITA to use continuous layout so that new chapters begin on the page that follows the previous chapter no matter what's the page number even or odd?

Currently I have blank pages following the title page and most of my chapters. I want the document to be transformed without them.

Thank you.
Exotic Hadron
Posts: 25

Re: Using bookmaps and PDF2 transformation: how to enable continuous paging and stop chapters from starting on even page

Thu Aug 10, 2017 6:31 pm

Figured.

Pagination is controlled by the PDF2 plugin that transforms DITA into PDF. Settings for the PDF2 plugin are defined in the commons-attr.xsl file. By default, this file is located under the following DITA-OT\plugins\org.dita.pdf2\cfg\fo\attrs.

Within this file there is the __force__page__count attribute section. The section controls pagination for the BOOKMAP files and other types of DITA files.

The default settings looks as:

Code: Select all

<!-- Default setting: "End chapters of even page"-->
    <xsl:attribute-set name="__force__page__count">
        <xsl:attribute name="force-page-count">
            <xsl:choose>
                <xsl:when test="name(/*) = 'bookmap'">
                    <xsl:value-of select="'even'"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="'auto'"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:attribute>
    </xsl:attribute-set>


the following lines set the chapters to end on even pages for the BOOKMAP files:

Code: Select all

<xsl:when test="name(/*) = 'bookmap'">
  <xsl:value-of select="'even'"/>
</xsl:when>

This means that when the text in a chapter ends on an odd page, PDF2 adds a blank page after that page, so the the chapter ends on an even page.

For all other cases, automatic pagination applies to that pages run continuously, and no blank pages are added:

Code: Select all

<xsl:otherwise>
  <xsl:value-of select="'auto'"/>
</xsl:otherwise>


We have to open this file in a text editor and change the selection value from 'even' to 'auto' (mind the quotes, they are required) for the BOOKMAP test:

Code: Select all

<!-- Default setting: "End chapters of even page"-->
    <xsl:attribute-set name="__force__page__count">
        <xsl:attribute name="force-page-count">
            <xsl:choose>
                <xsl:when test="name(/*) = 'bookmap'">
                   <xsl:value-of select="'auto'"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="'auto'"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:attribute>
    </xsl:attribute-set>


Change the changes. Now if you run PDF transformation, you won't see blank pages at the end of chapters anymore and your pages in the PDF files will run continuously. Happy online publishing.
Costin
Posts: 418

Re: Using bookmaps and PDF2 transformation: how to enable continuous paging and stop chapters from starting on even page

Fri Aug 11, 2017 12:52 pm

Hi Exotic Hadron,

I am happy to find that you managed to solve this already and I wish to congratulate you for that!

I would have just one suggestion, if I may.
It is not recommended to work with and apply the changes directly on the source files. The reason is that, when you would upgrade to a newer version (when it will become available) bundling a newer DITA OT, your changes would not persist (you should mack them up just to be sure you do not have to manually perform them again).

It is good practice to perform all the changes in an external directory (a dedicated customization folder).
More details about the suggested approaches are available even on the DITA OT website.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
Tay
Posts: 13

Re: Using bookmaps and PDF2 transformation: how to enable continuous paging and stop chapters from starting on even page

Fri Jun 01, 2018 9:52 am

Exotic Hadron wrote:Howdy,

I've moved my project from DITAMAP to BOOKMAP (thanks to Costin for his detailed explanation on how to achieve that).


Hello ! sorry to pull an old topic !
I've looked in the forum for this explanation and did not find it !
Could you please point me to it
Thank you
Costin
Posts: 418

Re: Using bookmaps and PDF2 transformation: how to enable continuous paging and stop chapters from starting on even page

Mon Jun 04, 2018 5:04 pm

Hello,

The thread Exotic Hadron referred to is this one.
He describes in the last post from that thread how he made it possible to migrate his DITA Map to the Book Map specialization.
However, the suggestions may apply for that specific use-case.

If you need thorough help to migrate or convert between different specializations, you could reach to a consultancy company.
We have a list of consultant companies on our website.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

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

Who is online

Users browsing this forum: No registered users and 1 guest