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.
-
- 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.
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.
-
- 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:
the following lines set the chapters to end on even pages for the BOOKMAP files:
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:
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:
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.
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>
Code: Select all
<xsl:when test="name(/*) = 'bookmap'">
<xsl:value-of select="'even'"/>
</xsl:when>
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>
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>
-
- Posts: 846
- 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
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
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
oXygen XML Editor and Author Support
-
- 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!
That looks wise. Thank you for your comment!
-
- 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
Hello ! sorry to pull an old topic !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).
I've looked in the forum for this explanation and did not find it !
Could you please point me to it
Thank you
-
- Posts: 846
- 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
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
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
oXygen XML Editor and Author Support
-
- 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
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
-
- 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)
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)
-
- Posts: 668
- 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
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
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)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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