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

Post here questions and problems related to editing and publishing DITA content.
Exotic Hadron
Posts: 25
Joined: Mon Aug 07, 2017 7:46 pm

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

Post by Exotic Hadron »

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
Joined: Mon Aug 07, 2017 7:46 pm

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

Post by Exotic Hadron »

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: 829
Joined: Mon Dec 05, 2011 6:04 pm

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

Post by Costin »

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
Exotic Hadron
Posts: 25
Joined: Mon Aug 07, 2017 7:46 pm

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

Post by Exotic Hadron »

Hi Costin,

That looks wise. Thank you for your comment!
Tay
Posts: 13
Joined: Fri Apr 13, 2018 4:45 pm

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

Post by Tay »

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: 829
Joined: Mon Dec 05, 2011 6:04 pm

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

Post by Costin »

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
mjpatterson
Posts: 5
Joined: Wed Jun 30, 2021 9:11 pm
Location: Halifax, Canada

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

Post by mjpatterson »

Hello all
I am using the HTML5 CSS transform to pdf and this is not working for me.
I am at a loss as to how to remove the blank pages.
Would anyone be able to assist me please?

Also -- would love for chapter 1 to start on p 1 ( presently it shows 5) but that is a much lower priority.
Many thanks
Mj
mjpatterson
Posts: 5
Joined: Wed Jun 30, 2021 9:11 pm
Location: Halifax, Canada

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

Post by mjpatterson »

I have managed to figure out one of the problems. stopping blank pages in pdf output.
For those who may need it, here are the magic words:

/* these are the magic words which cure the blank pages */
@page chapter{
-oxy-initial-page-number: auto;
}
/* these are the magic words which cure the blank pages */

I would still be grateful for how to set ONLY chapter 1 page to equal 1 ( the solutions I have found seem to want to restart all chapters at 1)
julien_lacour
Posts: 495
Joined: Wed Oct 16, 2019 3:47 pm

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

Post by julien_lacour »

Hello,

Regarding the page numbering, you can take a look at the How to Reset Page Numbering at First Chapter/Part from our user-guide.

Also, this topic was originally opened for the PDF2 transformation (DITA Map PDF - based on XSL-FO scenario) and is quite an old thread. Next time the best for this use-case is to open a new topic.

Regards,
Julien
Post Reply