Copy link to clipboard
Copied
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:
|
Copy link to clipboard
Copied
What version of Acrobat do you have?
Copy link to clipboard
Copied
Acrobat DC Version 2015.016.20045
I am a subscriber to creative cloud.
Copy link to clipboard
Copied
Can you post a screen shot of the dialog that you think should have the OK button?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You need to make the window bigger and then you'll see the OK button, to the left of the Cancel button.
Copy link to clipboard
Copied
OMG!!!! That is just too funny!!!!
I've been spending hours....and just plucked out the last hair on my
head....Thank you!!!
Copy link to clipboard
Copied
Further follow up question.
I got this functioning. But...what I would like to accomplish is that this form is available for various people to access, When they go to print it out then the date and time automatically update and print out with the date/time that the form is printed. Currently this has a stagnant date time that is reflective of when I created the form.
Copy link to clipboard
Copied
No, it should update each time the file is opened.
If you want it to update before each time the file is printed instead then you should click the Document Actions button instead of Document JavaScripts and then set that code under the Document Will Print event.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now