• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[XSL/FO] displaying date in pdf file

 
Chris Neff
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings to all.
My first post in this community, so let's get startet with...
I'm facing a problem, creating PDF-Files using FO-source in a XSL-file.
What's given:
I use stylesheet version="1.0" and two xmlns:xsl (.../1999/XSL/Transform, .../1999/XSL/Format)
The <fo:root ...> is also .../1999/XSL/Format
What I'm trying to do:
I want to print the date-of-creation-of-the-PDF-file in the PDF-file itself. I am using a XSL-file with <fo:...></fo:...> syntax.
I tried it with

<xsl:script>
<![CDATA[
function retDate() {
var now = new Date();
return now;
}
]]>
</xsl:script>
<xsl:eval>
retDate()
</xsl:eval>

It does not work - the generation of the PDF with the FOP engine stops with no reasonable (for me) error.
If I want to display the page-number, I can simply use <fo age-number/>. Does such a command exist for Date and Time information?
If you're missing more information to give me advice, just tell me and I'll provide you with everything I know.
Thank you very much!
 
Tony Yan
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the output of your .fo file? can you post that? I have a feeling that the error generated when XSL transformation is run before the pdf generation (XSL-FO). Could be a version issue.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pumpelche welcome to the forums, just to let you know, the Ranch only has one rule and that deals with naming. Please change your name to fit the JavaRanch guidelines. Please read the naming policy below.
Naming Policy: http://www.javaranch.com/name.jsp
You can change your display name by clicking here: http://www.coderanch.com/forums/user/edit
Thank You
Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic