Copy link to clipboard
Copied
Hello,
I need to create a PDF document that has a date that updates each time the document is opened.
The document can be created in indesign, but the end user will not have access to indesign, therefore it has to be updated automatically in Acrobat.
Thank you,
Travis
Copy link to clipboard
Copied
Add a text field to the PDF. Let's say the name of this text field is "CurrentDate". Add this code to a Document Level Script
this.getField("CurrentDate").value = util.printd("mm/dd/yyyy", new Date());
Here's an article on document level scripts:
Basic Document Level (Document Open) Scripts
Copy link to clipboard
Copied
Example Acrobat JavaScripts has the code and example PDFs. The description of how to add the code is outdated but the examples continue to work and are accessible through Prepare Forms => More => Document JavaScripts or through the JavaScript tool.