DITA: Jump start pdf plugin for customized pdf output

DITA: Jump start pdf plugin for customized pdf output
dita to pdf custom plugin

As you know DITA-OT can convert collection of topics into various output format such as pdf,xhtml or webhelp. However, there is always a need to create pdf outputs with your company logo, specific header and footer, probably one that is matching with your corporate literature and website theme. You can achieve this by creating your own plugin.

Basically DITA-OT transforms DITA Topics Files into an intermediate format and then sends it to the fo processor to convert directly into the pdf format.

We can customize fo plugin to generate outputs as per our needs. However, one should never touch the original fo plugin but create one for own needs.

In the year 2008 Jarno Elovirta had written a tool to automate DTD and specialization generation. Later on it was converted into custom pdf plugin generator. Though it has few limitations I found it very useful as a starting point while creating your first pdf plugin. In other words, for creating the skeleton of pdf plugin.Here is a jump start tip for creating your own pdf plugin.

1. Open Jarno Elovirta’s PDF Plugin generator that is hosted at following url

https://dita-generator-hrd.appspot.com/pdf-plugin/

Figure 1.1

2. Click Next, Select page size, margins and columns as shown in the figure 1.2

Figure 1.2

3. Though It doesn’t have much detailed options to customize header and footer but you can select some for header content and other layout options as shown in the figure 1.3

Figure 1.3

4. Select style attributes as shown in the figure 1.4 and click Next.

Further, there is an option to setup cover page however, I recommend ignoring this selection. You may select the task labels checkbox. Remember we are just creating basic pdf plugin, once your basic plugin is ready there are more sophisticated ways to customize the cover page.

 

Figure 1.5

5. Finally, enter the Plugin ID and desired transtype.You may specificy the Plugin version too. Click Generate to download your newly created plugin.

Figure 1.5

6. Unzip your the downloaded plugin file and copy entire plugin folder into DITA-OT install folder’s plugins subfolder. My plugin’s downloaded and unzipped folder name is com.mycompany.website-ug.

7. Simply, place the folder at following location.

<DITA-OT_INSTALL_FOLDER>/plugins/com.mycompany.website-ug

8. Now, open custom.xsl from the following location to do some corrections.

<DITA-OT_INSTALL_FOLDER>/plugins/com.mycompany.website-ug/cfg/fo/xsl/custom.xsl

Select entire section under <!–cover–> as shown in the figure below and delete. Save the custom.xsl file.

Figure 1.6

9. Now, your custom pdf plugin is ready to generate pdf output.From the <DITA-OT_INSTALL_FOLDER> run startcmd.bat and enter the following command

java -jar lib/dost.jar /i:samples/taskbook.ditamap /outdir:./out /transtype:websiteUG

Go and check the out folder under the <DITA-OT_INSTALL_FOLDER> for generated pdf output. I hope that sharing this jump start tip for creating DITA-OT pdf plugin will help helpful so, later on you can explore more sophisticated customization.

Krishna Meet is a technical writer and UX designer having core interest in analytical dashboard designing. Majority of her career span was into tech-writing. However, she thrives by intersecting multiple skill-sets : DITA documentation, script writing for tech-videos, business analysis, and UX design. She is a voracious reader and possesses Masters degree in Computer Science. Her interest in agile methodologies and user-centered design has landed her a techno-functional role at Brevitaz.

0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*