PDF from ditamap, force pagebreak between topics
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: PDF from ditamap, force pagebreak between topics
Hi mdslup,
Are you using the predefined general PDF transformation scenario (DITA Map PDF - based on XSL-FO), or one of the predefined CSS-based scenarios?
However, breaking the page before new topics is possible in both cases.
Depending on the specific transformation scenario, you should follow the instructions:
from the User-Guide (for the CSS based)
https://www.oxygenxml.com/doc/versions/ ... aking.html
from Radu's blog post (for the XSL-FO based - DITA Map PDF scenario)
http://blog.oxygenxml.com/2015/04/dita- ... reaks.html
Regards,
Costin
Are you using the predefined general PDF transformation scenario (DITA Map PDF - based on XSL-FO), or one of the predefined CSS-based scenarios?
However, breaking the page before new topics is possible in both cases.
Depending on the specific transformation scenario, you should follow the instructions:
from the User-Guide (for the CSS based)
https://www.oxygenxml.com/doc/versions/ ... aking.html
from Radu's blog post (for the XSL-FO based - DITA Map PDF scenario)
http://blog.oxygenxml.com/2015/04/dita- ... reaks.html
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
-
- Posts: 167
- Joined: Tue Mar 06, 2018 1:34 am
Re: PDF from ditamap, force pagebreak between topics
I maintain a custom PDF transformation scenario that is based on the Oxygen out-of-the-box scenario. My custom transformation points to my custom XSL files using the customization.dir parameter. I have successfully implemented many changes to my PDF output using this workflow, such as page rotation, column count, headers, footers, etc. In fact, I produce documents of different column counts nearly every week, so I know these files are properly hooked up.
What you described seemed simple, but I could not get it to work. Can you help me identify my issue, if you have time?
In my ditamap file, I added the processing instruction:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<title>My Map Title</title>
<topicref
href="Cover.dita"/>
<?pagebreak?>
<topicref
href="Installation.dita"/>
...
</map>
I verified that, in author mode, that was in fact a page break processing-instruction. I added the following code to my customization file (customization-directory\fo\xsl\custom.xsl):
<xsl:template match="processing-instruction('pagebreak')">
<fo:block break-after="page"/>
</xsl:template>
I ran my transformation and the page break did not apply.
I tried moving the pagebreak into the first topic file itself, both like this:
<reference>
...
<?pagebreak?>
</reference>
and like this:
<reference>
...
</reference>
<?pagebreak?>
But the page break didn't apply. Any thoughts?
What you described seemed simple, but I could not get it to work. Can you help me identify my issue, if you have time?
In my ditamap file, I added the processing instruction:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<title>My Map Title</title>
<topicref
href="Cover.dita"/>
<?pagebreak?>
<topicref
href="Installation.dita"/>
...
</map>
I verified that, in author mode, that was in fact a page break processing-instruction. I added the following code to my customization file (customization-directory\fo\xsl\custom.xsl):
<xsl:template match="processing-instruction('pagebreak')">
<fo:block break-after="page"/>
</xsl:template>
I ran my transformation and the page break did not apply.
I tried moving the pagebreak into the first topic file itself, both like this:
<reference>
...
<?pagebreak?>
</reference>
and like this:
<reference>
...
</reference>
<?pagebreak?>
But the page break didn't apply. Any thoughts?
-
- Posts: 9450
- Joined: Fri Jul 09, 2004 5:18 pm
Re: PDF from ditamap, force pagebreak between topics
Hi,
If you want to break the page before a topic for the XSL-FO-based PDF output maybe this thread will help:
topic13829.html
You need to override the attributes set for each topic and somehow decide to add a "break-before='page'" attribute on it.
There is a also a book called "DITA For Print" which has lots of PDF customization examples.
And you can also ask around on the Yahoo Groups DITA Users List.
Regards,
Radu
If you want to break the page before a topic for the XSL-FO-based PDF output maybe this thread will help:
topic13829.html
You need to override the attributes set for each topic and somehow decide to add a "break-before='page'" attribute on it.
There is a also a book called "DITA For Print" which has lots of PDF customization examples.
And you can also ask around on the Yahoo Groups DITA Users List.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 11
- Joined: Tue Aug 23, 2016 6:18 pm
Re: PDF from ditamap, force pagebreak between topics
Post by Quick van Rijt »
In DITA 3.x, refer to the use of the following plugin:
https://github.com/dita-community/org.d ... page-break
This plugin enables you to force a new page in a topic body.
To implement one (or more) new page insertions before a topic, append to file pageBreak.xsl:
You can start the concept topic on a new page by inserting:
https://github.com/dita-community/org.d ... page-break
This plugin enables you to force a new page in a topic body.
Code: Select all
<body>
<p>--- before pagebreak ---</p>
<?pagebreak?>
<p>--- after pagebreak ---</p>
</body>
Code: Select all
<xsl:template match="*" mode="processTopic">
<xsl:for-each select="prolog/process-instruction('pagebreak')">
<fo:block break-before="page"/>
</xsl:for-each>
<xsl:next-match/> <!-- hand-over processing to lower priority (current) matching template -->
</xsl:template>
Code: Select all
<prolog>
<?pagebreak?>
</prolog>
<conbody>
…
</conbody>
Regards
Quick van Rijt
Professional user of Oxygen XML and DITA OT
Quick van Rijt
Professional user of Oxygen XML and DITA OT
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