DocBook page breaks for PDF

Oxygen general issues.
reasty
Posts: 1
Joined: Sat Oct 01, 2011 5:03 pm

DocBook page breaks for PDF

Post by reasty »

Hi

I'm new to oxyGen and DocBook so please excuse my simple question while I check out the trial version

I am trying to add forced page breaks to my title page and contents pages for PDF output

Other forum entries have suggested the tag

Code: Select all


<?hard-pagebreak?>
but I've not been able to add a custom stylesheet to enable it

I'm not sure this is the best way to get a page break, and would welcome any suggestions

Thanks in advance,

Richard
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: DocBook page breaks for PDF

Post by Radu »

Hi Richard,

So a good guide for Docbook page breaking is here:

http://www.sagehill.net/docbookxsl/PageBreaking.html

The guide discusses soft page breaks (which are implemented in the Docbook stylesheets) and hard page breaks which can be obtained by customizing the stylesheets:

Code: Select all

Although the DocBook XSL stylesheets do not provide direct support for hard (unconditional) page breaks, you can implement your own as a customization
This means that in the stylesheet:

OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/fo/docbook_custom.xsl

you can add an extra xsl:template:

Code: Select all


    <xsl:template match="processing-instruction('hard-pagebreak')">
<fo:block break-after='page'/>
</xsl:template>
and thus match the PI from the XML and generate a block which forces page break.

I would also suggest you to register on the Docbook Apps mailing list:
http://www.docbook.org/guidelines
on which you can also ask customization questions and get access to a lot of Docbook customization experts.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply