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!

Print date

Status
Not open for further replies.

Viruland

Programmer
Dec 6, 2000
61
BE
I'm using Acrobat Writer 5.0 and I'm 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.





Live fast, die young and leave a beautiful corpse behind.
 
If you do a keyword search for time and/or date in the acrobat forum you should find lots of useful tips.

Hope this helps

Ahhhhh, I see you have a machine that goes Bing!
 
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.

 
Thanx a lot rphbrew.

You may send me the code how to create a button.

Viruland

Live fast, die young and leave a beautiful corpse behind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top