During the lab, you will specialize the default DITA Open Toolkit PDF output to customize the titles and headers and footers of each page.
com.componize.custom-pdf
plugin from the Eclipse
resources into the plugins
folder located in your DITA Open Toolkit
installation.
cfg/common/vars
folder, open the
en.xml
file in your favorite editor.
<variable id="Product Name">Componize</variable>
Copyright © 2018 Componize Software   <param ref-name="pagenum" />
<variable id="Body odd footer"> Copyright © 2018 Componize Software   <param ref-name="pagenum" /> </variable>
<param ref-name="pagenum" />   Copyright © 2018 Componize Software
<variable id="Body even footer"> <param ref-name="pagenum" />   Copyright © 2018 Componize Software </variable>
cfg/fo/attrs
folder, remove the .orig
extension from the custom.xsl.orig
file.
custom.xsl
file in your favorite editor.
<xsl:attribute-set name="topic.title"> <xsl:attribute name="break-before">page</xsl:attribute> <xsl:attribute name="font-size">18pt</xsl:attribute> <xsl:attribute name="font-weight">normal</xsl:attribute> <xsl:attribute name="color">#132E5E</xsl:attribute> <xsl:attribute name="space-after.minimum">0.6em</xsl:attribute> <xsl:attribute name="space-after.optimum">0.8em</xsl:attribute> <xsl:attribute name="space-after.maximum">0.8em</xsl:attribute> <xsl:attribute name="space-after.precedence">1</xsl:attribute> <xsl:attribute name="start-indent">0pt</xsl:attribute> <xsl:attribute name="border-after-style">solid</xsl:attribute> <xsl:attribute name="border-after-width">1pt</xsl:attribute> <xsl:attribute name="border-color">#cccccc</xsl:attribute> </xsl:attribute-set>
cfg/
folder, remove the .orig
extension from the catalog.xml.orig
file.
catalog.xml
file in your favorite editor.
<uri name="cfg:fo/attrs/custom.xsl" uri="fo/attrs/custom.xsl"/> <uri name="cfg:/common/vars/en_US.xml" uri="common/vars/en.xml" /> <uri name="cfg:/common/vars/en.xml" uri="common/vars/en.xml" />
bin
folder located in your DITA Open Toolkit
installation, run the following command: dita --install
ditaot-pdf.xml
. Add a new
transtype option which points to custom-pdf.
<?xml version="1.0" encoding="UTF-8"?> <pipelineConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="cpnz:pipeline:xsd:pipeline-configuration.xsd"> <pipeline>ditaot-pdf</pipeline> <options> <option> <name>transtype</name> <value>custom-pdf</value> </option> …
The PDF output should have customized level one titles and headers and footers on each page.