Here should go questions about transforming XML with XSLT and FOP.
Posts: 19
Joined: Thu Mar 29, 2012 4:45 pm


Post by SimonH » Thu Apr 28, 2016 3:58 pm

Has anyone modified the keep-together rules to support better pagination from the DITA-OT with Apache FOP. I notice things like a stepresult are allowed to flow onto a new page without the step. Likewise I get the odd 1 line paragraph in a table that gets split to the next page.

Do any of the other renderers do a better job of pagination or do I need to hack around the XSLT and set properties on some elements to try keep stuff together better.


Posts: 336
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova

Re: Pagination

Post by radu_pisoi » Tue May 03, 2016 3:14 pm


To avoid that a stepresult to be placed at the start of a new page you can set the 'keep-together' XSL-FO property to the 'steps.step' attribute set.

To do this, you need to create a DITA PDF customization plugin or to set a Customization Directory for PDF Output. A detailed procedure for
the second method can be found here:
* ... ation.html

In [DITA-PDF-Customization]/fo/attrs/custom.xsl (make sure you renamed the 'custom.xsl' file from 'custom.xsl.orig' and un-comment the entry to it in 'catalog.xml') add the next attribute set:

Code: Select all

<xsl:attribute-set name="steps.step" use-attribute-sets="">
<xsl:attribute name="space-after">3pt</xsl:attribute>
<xsl:attribute name="space-before">3pt</xsl:attribute>

<xsl:attribute name="keep-together.within-page">always</xsl:attribute>
I think that a similar customization can be done for the table cells.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Posts: 2
Joined: Mon Jun 13, 2016 11:30 am

Re: Pagination

Post by majacques » Wed Aug 16, 2017 5:37 pm


I am currently facing the same situation, both for stepresults and info elements after a step, when stepresults and info elements contain a lot of text, and setting the keep-together.within-page attribute, for steps.step, to "always", did not solve the issue.
Where else can I look to fix this?

Thank you,


Posts: 6180
Joined: Fri Jul 09, 2004 5:18 pm

Re: Pagination

Post by Radu » Thu Aug 17, 2017 9:06 am

Hi Marc,

Are you generating the PDF using the default Apache FOP processor or using one of the commercial PDF processors like Antenna House or RenderX XEP?
Are you sure that your customization is applied? If you set the "clean.temp" parameter to "no" in the transformation scenario and after the transformation open the "" XSL-FO file from the transformation temporary folder, does it contain your customization?
If it does, maybe you can zip and send us a small DITA project exemplifying the problem + your PDF customization folder or plugin:

Radu Coravu
<oXygen/> XML Editor

Post Reply