The moose likes XML and Related Technologies and the fly likes [XSL/FO] displaying date in pdf file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "[XSL/FO] displaying date in pdf file" Watch "[XSL/FO] displaying date in pdf file" New topic

[XSL/FO] displaying date in pdf file

Chris Neff

Joined: Jun 04, 2003
Posts: 4
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

function retDate() {
var now = new Date();
return now;

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!

Chris Neff, aka Pumpelche<p><a href="" target="_blank" rel="nofollow"></a> |
Tony Yan
Ranch Hand

Joined: Apr 10, 2002
Posts: 170
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.

Tony Yan<br /> <br />IBM Certified Developer XML and Related Technology<br />Sun Certified Web Component Developer For J2EE Platform<br />Sun Certified Programmer For Java 2 Platform
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
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:
You can change your display name by clicking here:
Thank You
I agree. Here's the link:
subject: [XSL/FO] displaying date in pdf file
It's not a secret anymore!