Setting header and footers for DITA PDF
Post here questions and problems related to editing and publishing DITA content.
Setting header and footers for DITA PDF
I'm working in the my XML customization directory trying to change the headers, footers and various other elements in my DITA PDF output.
I've added the "template name="insertBodyEvenHeader">" to customized custom.xsl file, and am attempting to change the <my_customization>/common/var/en.xml file to set my product values. For example, I'm trying to change the product name variable <variable id="Product Name"/>. But no matter how I try to change it (for example <variable id="Widget 3000"/>, or <variable id="Product Name, 'Widget 3000'"/>, or <variable id="Product Name="Widget 3000""/> ...etc), nothing seems to work.
I've also tried setting values within the insertBodyEvenHeader template, but my guess is this isn't a good place to set values as they'd have to be changed for each language.
Where am I going wrong, apart from having little experience with XML and XSL.
Thanks
I've added the "template name="insertBodyEvenHeader">" to customized custom.xsl file, and am attempting to change the <my_customization>/common/var/en.xml file to set my product values. For example, I'm trying to change the product name variable <variable id="Product Name"/>. But no matter how I try to change it (for example <variable id="Widget 3000"/>, or <variable id="Product Name, 'Widget 3000'"/>, or <variable id="Product Name="Widget 3000""/> ...etc), nothing seems to work.
I've also tried setting values within the insertBodyEvenHeader template, but my guess is this isn't a good place to set values as they'd have to be changed for each language.
Where am I going wrong, apart from having little experience with XML and XSL.
Thanks
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Setting header and footers for DITA PDF
Post by sorin_ristache »
Hi,
You just have to follow the instructions for customizing the PDF transformation from the file [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\README.txt. If you add your modifications in the default directory for such customizations, which is [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\Customization, then you should do the following:
Regards,
Sorin
You just have to follow the instructions for customizing the PDF transformation from the file [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\README.txt. If you add your modifications in the default directory for such customizations, which is [Oxygen-install-dir]\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\Customization, then you should do the following:
- Duplicate the file org.dita.pdf2\Customization\fo\xsl\custom.xsl.orig and rename it to custom.xsl.
- Add the following templates to this file (copied from org.dita.pdf2\xsl\fo\static-content.xsl) and customize them in any way you want:
Code: Select all
<xsl:template name="insertBodyOddHeader">
<xsl:template name="insertBodyEvenHeader">
<xsl:template name="insertBodyOddFooter">
<xsl:template name="insertBodyEvenFooter"> - Duplicate the file org.dita.pdf2\Customization\fo\attrs\custom.xsl.orig and rename it to custom.xsl.
- Add the following element in this stylesheet which will enable the even headers and footers (by default only the odd headers and footers are enabled, this is why you did not see your even header customization in the PDF output):
Code: Select all
<xsl:variable name="mirror-page-margins" select="true()"/>
- Uncomment the following two declarations in the catalog file org.dita.pdf2\Customization\catalog.xml:
Code: Select all
<uri name="cfg:fo/attrs/custom.xsl" uri="fo/attrs/custom.xsl"/>
<uri name="cfg:fo/xsl/custom.xsl" uri="fo/xsl/custom.xsl"/> - Edit the DITA PDF transformation and set the path of the directory org.dita.pdf2\Customization in the parameter called customization.dir.
- Run the DITA PDF transformation again to add the custom headers and footers in the PDF output.
Regards,
Sorin
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