Page 1 of 1

Ask a suppor to share the logic of customize PDF transformation

Posted: Tue Jul 11, 2017 9:50 am
by lisazeng
Hi Oxygen expert,

My tools: Dita OT2.5

I have download your pdf plugin and test it successfully.
Then I want to update your plugin for PDF transfor mation
. Add footer and header
. Add new cover page , first page and last page.
.format the pragraph, table and other elements of PDF.

What I understand now:
In Customization
---attrs (includes attributes xls files)
---xsl ( includes how to transform attributes)

For example, if i want to change the header and footer, i need to rewrite the static-content-attr.xsl in attrs folder and static-content.xsl in xsl folder. of course I need to added them in the seperate custom.xsl.
My question comes:
1. how do I know which xsl i need to rewrite in attr and xsl folder? their name and their content. doese this mean I need to copy some file from somewhere?

2. how do I know which part should be rewrite? for example, in static-content.xsl , there are several templates about oddfooter, evenfooter, indexfooter and others. How should I know which one is used for what?

3. if it is possible, as I mentioned in above, to achieve these functions, which xls should I rewrite and what content should I rewrite?
I really want to understand the logic of how to customize the pdf output as I tried to use it for next pdf publicaion, which might come in 2 weeks.

Thanks so much!

Re: Ask a suppor to share the logic of customize PDF transformation

Posted: Wed Jul 12, 2017 11:49 am
by ionela

DITA Map to PDF transformation scenario is based on the DITA-OT PDF2 plugin:
Customizing this transformation is possible, but it requires solid knowledge of XSLT and XSL-FO technologies:

If you choose this method, a good starting point is this customization (we also use this to publish the Oxygen User Guide):

This plugin includes the following customizations for particular parts of the PDF:
  • Custom fonts
  • Cover page
  • Page headers and footers
  • First page in a chapter
  • TOC and Index
These customizations are explained in greater detail here:

Another alternative to customize the PDF output is to use the DITA Map PDF - WYSIWYG transformation scenario. This scenario converts DITA maps to PDF using a CSS layout processor. So, if you want to customize the generated PDF, you need to write CSS rules. This transformation scenario is described in more detail here:

This second approach has some disadvantages:
- the localization support does not work out-of-the-box and requires some additional CSS rules (based on the :lang() CSS selector)
- if you use the Oxygen Chemistry CSS processor in its current form, you cannot automate the transformation process from a CLI script.

So, to summarize:
1. The first method is very powerful and allows you to achieve a great level of customization, but it requires solid knowledge of XSLT and XSL-FO.
2. The second method relies on CSS, which is far easier to understand and develop, but depending on the CSS processor you choose, it might involve additional expenses (Prince and Antenna House) or some initial delays (Oxygen Chemistry) until a more powerful version is released.