These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Dynamic Stamps - Is There An Alternate Code To Show Date?

lisawf
Registered: Dec 7 2007
Posts: 2

Hi, I've created a custom dynamic stamp which when used shows a person's name and current date by using the Javascript code from Acrobat's own dynamic stamps:
 
event.value = (new Date()).toString();
AFDate_FormatEx("h:MM tt, mmm dd, yyyy");
event.value = "By " + ((!identity.name || identity.loginName != (event.source.source || this).Collab.user) ? (event.source.source || this).Collab.user : identity.name)
+ " at " + event.value;
 
Works fine in Acrobat 7 but not 8, the date is missing and from what I can gather it's a bug and may have something to do with the clocks going back.
 
Is there a alternate code I could use to do the same thing please as I really need to fix it?
 
Cheers
Lisa

My Product Information:
Acrobat Pro 8.0999999999999996447286321199499070644378662109375, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Don't use the "Date.toString()" or the "AFDate_FormatEx()" functions. Instead use the regular date formatting tools. You'll find examples in this article.

[url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/date_time_part1/]http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/date_time_part1/[/url]

You might also want to read more about Dynamic Stamps here:

[url=http://www.acrobatusers.com/tutorials/2007/dynamic_stamp_secrets/]http://www.acrobatusers.com/tutorials/2007/dynamic_stamp_secrets/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script