General XMetaL Discussion
itsme January 14, 2009 at 5:25 am
Generate date at PDF output footerJanuary 14, 2009 at 5:25 amParticipants 2Replies 3Last Activity 14 years ago
I would like to ask if it's possible to generate out the date in the footer when we publish out in PDF document? How do i go about doing this?Chris January 16, 2009 at 8:19 pm
Reply to: Generate date at PDF output footerJanuary 16, 2009 at 8:19 pm
XSL isn't very good at dates and times, so the nice people at http://www.exslt.org/ have created some XSL extension functions, including those for date and time. The DITA Open Toolkit already uses some of the exslt.org extension functions, so all you have to do is add the reference to the dates-and-times library, and then use the function.
You'll need to modify your [customization]/fo/xsl/custom.xsl file:
1. Add a refernce to the exslt.org dates-and-times library (changes in bold):
exclude-result-prefixes=”opentopic exslf opentopic-func”
2. Create a variable to be used by your footer template:
3. Add the $footerDate variable to your footer template(s);
e.g. for PDF3 (XMetaL Enhanced PDF), to change the footer on odd-numbered pages, you need to override the __body__odd__footer__* parameters from [customization]/fo/xsl/xm_static_content.xsl:
This will put the string “2009-01-16T11:40:40-08:00” into your footer.
For more info on the date functions, see:
Chrisitsme January 19, 2009 at 1:29 am
Reply to: Generate date at PDF output footerJanuary 19, 2009 at 1:29 am
Thanks a lot! I'll try it out:)
itsmesaumitra July 1, 2009 at 4:38 am
Reply to: Generate date at PDF output footerJuly 1, 2009 at 4:38 am
Is it also possible to add total number of pages. I want to display “Page X of Y” in the header – is this doable?
I am able to add Page X (using $xmPageNumber) but I am not aware of the variable for the total number of pages.
Can you please help?
- You must be logged in to reply to this topic.