todays date in acrobat
I would like to create a form that when printed the date it is printed appears on the top of the form. I have found the following;
In brief:
1. Add form field with the read only property and hidden but printable general options.
2. Add a JavaScript tot the Will Print document action.
this.getField("PrintDateFieldName").value = "Printed on: " +util.printd("mmm d, yyyy", new Date()) + " at " + util.printd("h:MM tt", new Date());
You need to change the field name to your field name and the format of the date and time to the style you want.
Working with date and time in Acrobat JavaScript - Part 2 by Thom Parker
The problem I have having with these instructions are the following; when I go to Add the JavaScript a box appears to add javascript and when you put in the javascript the two options you have is "cancel" or "Go to" and you have to choose a line in the ?document? or ?editor? . All the instructions I can find regarding this all say to add the javascript and hit close or OK but neither is an option when adding new javascript. Any advice?
Look at similar directions below. I know I am a novice...please be gentle with me ![]()
10down voteaccepted | Remove your script and replace it with the following document javascript: var f = this.getField("wells_datefield"); if (!f.value) f.value = util.printd ("m/d/yyyy", new Date()); Save your form and open it, and the date should pop right in there. When making the document javascript, remember to not put it inside a function. One way of doing that is the following. In the Acrobat menu:
|
