Copy link to clipboard
Copied
I have a pdf document that does not contain any date. When I print the document I want the current date to print. I am looking for instructions to do this. I've found previous versions that suggest adding a text field and some javascript using the “document will print” feature under “document processing”, but I can’t find accurate/detailed instructions for it to work with Acrobar pro dc. I’m not familiar with scripting.
I also went to the text field properties and selected "hidden but printable" and it works perfect. The date does not appear on my document when viewing but prints current date.
Thank you very much. I've been scratching my head for 3 days trying to figure this out.
Copy link to clipboard
Copied
Did you create a text field to hold the date? If so, create it and call it Today.
Now go to Tools and search for "document actions". Click on the item found (called "Set Document Actions") and you'll see something like this:
Select the Document Will Print item and click on Edit.
In the window that opens paste this code and then press OK:
this.getField("Today").value = util.printd("mm/dd/yyyy", new Date());
That's it, pretty much. Save the file and the next time you print it the field will be populated automatically.
Copy link to clipboard
Copied
Thanks for the info. It didn't work for me. I inserted a text field and called it TODAY. Do I need to look at the properties of this text box and perhaps change something there?
Copy link to clipboard
Copied
Then you must use:
this.getField("TODAY").value = util.printd("mm/dd/yyyy", new Date());
Copy link to clipboard
Copied
It's still not printing the date. In the text field - Properties - General tab, what should the "Common properties" be? Could that make a difference?
Copy link to clipboard
Copied
Where do you see "Common properties"? Your text field needs no special properties, just create it in the forms editor ("Prepare Form").
Just make sure that you select "Format" to "None". Then use the script that was already provided as your "Document Will Print" action. Make sure that the field name is spelled the same way in both the field's properties and the script.
Copy link to clipboard
Copied
I also went to the text field properties and selected "hidden but printable" and it works perfect. The date does not appear on my document when viewing but prints current date.
Thank you very much. I've been scratching my head for 3 days trying to figure this out.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now