Main steps for customization of PDF output generated from DocBook XML
documents.
When the default layout and output look of the DocBook to PDF transformation need to
be customized, the following main steps should be followed. In this example a
company logo image is added to the front matter of a book. Other types of
customizations should follow some similar steps.
-
Create a custom version of the DocBook title spec file.
You should start from a copy of the file [OXYGEN_INSTALL_DIR]/frameworks/docbook/xsl/fo/titlepage.templates.xml and customize it. The
instructions for the spec file can be found here.
An example of spec file:
<t:titlepage-content t:side="recto">
<mediaobject/>
<title
t:named-template="book.verso.title"
font-size="&hsize2;"
font-weight="bold"
font-family="{$title.font.family}"/>
<corpauthor/>
...
</t:titlepage-content>
-
Generate a new XSLT stylesheet from the title spec file from the previous
step.
Apply [OXYGEN_INSTALL_DIR]/frameworks/docbook/xsl/template/titlepage.xsl to the title spec file. The
result is an XSLT stylesheet (for example, mytitlepages.xsl).
-
Import mytitlepages.xsl in a DocBook customization layer.
The customization layer is the stylesheet that will be applied to the XML
document. The
mytitlepages.xsl should be imported with an element
like
this:
<xsl:import href="dir-name/mytitlepages.xsl"/>
-
Insert logo image in the XML document.
The path to the logo image must be inserted in the
book/info/mediaobject element of the XML document.
-
Apply the customization layer to the XML document.
A quick way is to duplicate the transformation scenario
DocBook PDF
that is included with
Oxygen XML Author and set the customization layer in
the XSL URL property of the
scenario.