1 person found this helpful
Do you want this set when the PDF is opened, in all cases? Or is there a situation where is should not change?
Remove the calculation script.
Here is some code that will set the field to the current date when it is opened, but only if the field is blank.
Place this code in a document script and change the field name to your date field, and change the formatting to the date format you want.
var fld = this.getField("MyDate");
if(fld.value = "")
fld.value = util.printd("dd-mm-yy",new Date());
2 people found this helpful
Don't use a calculation script. The code was for a document script.
Here is an old article on entering document scripts, There have been some changes in the Acrobat UI, but most of the article is still acurate