Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date and Time Update Form

Status
Not open for further replies.

LeafEET

Technical User
Jun 26, 2003
1
US
I am looking for a way in a *.pdf file to automatically display the current time and date on each page of the file. It needs to at least update before being printed out each time. Also if there is a way to have text around the area.

Example:
************************************************************
Last printed 6/26/2003 9:41 AM
Uncontrolled Copy valid 24 hours after last printed date
************************************************************
Above is what is to be added to each of the pages so that when I print it out the above time and date are updated before printing. Any help would be greatly appreciated.

Thanks,

Ryan
 
Comment from AnnaNmty
Date: 12/11/2002 01:00PM PST
Comment


This process worked fine in my test:

1. Create a button object in your SOPs and call it "date" (no quotes)

2. In Tools, JavaScript, Set Document Actions, Document Will Print, Edit paste

/* Create a date object containing the current date. */
var d1 = new Date();

/* num contains the numeric representation of the current date. */
var num = d1.valueOf();

var f = this.getField("date");
f.buttonSetCaption("This printed copy expires two weeks after " + util.printd("mm/dd/yyyy", d1));

3. In Tools, JavaScript, Set Document Actions, Document Did Print, Edit paste

var f = this.getField("date");
f.buttonSetCaption("");

Would you like me to post how to create a button?

There is also a way to add fields programmatically, but I was not sure if that is something you would be interested in. Each SOP would have to have the same format because the field is put in a specific location. Let me know.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top