Ask a suppor to share the logic of customize PDF transformation
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 29
- Joined: Tue Jun 27, 2017 2:10 pm
Ask a suppor to share the logic of customize PDF transformation
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
-----fo
---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!
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
-----fo
---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!
-
- Posts: 407
- Joined: Mon Dec 05, 2011 6:08 pm
Re: Ask a suppor to share the logic of customize PDF transformation
Hi,
DITA Map to PDF transformation scenario is based on the DITA-OT PDF2 plugin:http://www.dita-ot.org/2.5/user-guide/dita2pdf.html
Customizing this transformation is possible, but it requires solid knowledge of XSLT and XSL-FO technologies:
https://www.w3.org/TR/xslt20/
https://www.w3.org/TR/xsl/
If you choose this method, a good starting point is this customization (we also use this to publish the Oxygen User Guide):
https://github.com/oxygenxml/com.oxygenxml.pdf2.ug
This plugin includes the following customizations for particular parts of the PDF:
https://github.com/oxygenxml/com.oxygenxml.pdf2.ug/wiki
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: https://www.oxygenxml.com/doc/versions/ ... dita2.html
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.
Regards,
Ionela
DITA Map to PDF transformation scenario is based on the DITA-OT PDF2 plugin:http://www.dita-ot.org/2.5/user-guide/dita2pdf.html
Customizing this transformation is possible, but it requires solid knowledge of XSLT and XSL-FO technologies:
https://www.w3.org/TR/xslt20/
https://www.w3.org/TR/xsl/
If you choose this method, a good starting point is this customization (we also use this to publish the Oxygen User Guide):
https://github.com/oxygenxml/com.oxygenxml.pdf2.ug
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
https://github.com/oxygenxml/com.oxygenxml.pdf2.ug/wiki
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: https://www.oxygenxml.com/doc/versions/ ... dita2.html
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.
Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service