Customizing PDF output
You can build a DITA-OT plug-in that contains a customized PDF transformation.
About this task
- Uses A4 paper
- Renders figures with a title at the top and a description at the bottom
- Use em dashes as the symbols for unordered lists
- In the plugins directory, create a directory named com.example.print-pdf.
In the new com.example.print-pdf directory, create a plug-in configuration file
(plugin.xml) that declares the new print-pdf transformation and its
Add an Ant script (integrator.xml) to define the transformation type.
In the new plug-in directory, add a cfg/catalog.xml file that specifies the custom
XSLT style sheets.
Create the cfg/fo/attrs/custom.xsl file, and add attribute and variable overrides to
For example, add the content highlighted with bold to change the page size to A4.
Create the cfg/fo/xsl/custom.xsl file, and add XSLT overrides to it.
For example, the following code changes the rendering of <figure> elements.
Create an English-language variable-definition file (cfg/common/vars/en.xml) and make
any necessary modifications to it.
For example, the following code removes the period after the number for an ordered-list item; it also specifies that the bullet for an unordered list item should be an em dash.
The new plug-in directory has the following layout and files:
com.example.print-pdf/ cfg/ common/ vars/ en.xml fo/ attrs/ custom.xsl xsl/ custom.xsl catalog.xml integrator.xml plugin.xml
What to do next
Run the integration process to install the plug-in and make the print-pdf transformation available.