PDF Plugin Creation – Part 1
This tutorial will show you how to create a custom plug-in, that will allow you to format your PDF output. I will be using Oxygen and Apache FOP, which is the built-in FO processor. If you want to use Antenna House, RenderX, or any other external FO processor, you might need to perform small modifications, but the main core ideas will be the same.
1. PDF Plugin Generator
Go to http://dita-generator.elovirta.com. Here you will be able to create the main skeleton of what you will need for your customization. Click next.
2. Page, Margins and Columns
Change this as desired. As you can see, besides the Columns, I have changed the rest. Click next.
3. Header, Footer and Layout
I don’t want anything on my page headers so I will leave those empty. For the footer, I will add # title and chapter # but, most likely, I will change those later. You can add those by dragging from the options available above. The rest stays as-is. Click next.
4. Style, Formatting, Indents and Spacing
Most of the customization happens here. You can change all these values later, but it is important that you have a clear idea of what is your desired output at this stage. I will highlight all the changes I made, if there is an style that I am not showing here, is because I did not make any changes to those. Once you change all your styles, click next.
4.2 Heading 1
4.3 Heading 2
4.4 Heading 3
4.5 Heading 4
4.7 Code Block
4.8 Ordered List
4.11 TOC 1
4.12 TOC 2
4.13 TOC 3
4.14 TOC 4
5. Cover, Table of Contents, Page Numbering, PDF Bookmarks, Labels and Linking
I need my Table of Contents (TOC) to show 4 levels instead of 3. The rest can stay as-is. Click next.
Now, we will give the plug-in an ID and also a Transtype. The ID should be in the format com.client.pdf. If you are planning on having multiple, different plug-ins for one client, you can name them com.client.pdf-reg for regular books, com.client.pdf-shr for short books, etc. The Transtype will be important to identify, inside of Oxygen, which kind of books this is. You can name your Transtype pdfreg for regular books and pdfshr for short books, i.e. You can also add a version to your plug-in, but that is totally optional. Click on Generate.
Go to your download folder. This is what was generated and downloaded. In Part 2, I will show you how to integrate the plug-in into Oxygen. We will print a sample page, and learn how to make many more customizations.