Copy link to clipboard
Copied
Greetings,
I have read a lot of different comments across the internet concerning solutions with the self-updating date in the footer area. Unfortunately I was not able to manage to make it work. It seems that the only way to archieve the goal, is the java way. And I have NO idea of java honestly.
So here is the task:
We have PDFs which, when printed, have a tenability of 5 days. So the printing date has to change automatically when opened on every single page.
So how can I archieve this?
Thank you very much for your support & best regards,
Axl
The easiest way of doing it is with a text field. Create such a field and call it "PrintText". Set its visibility to "Hidden but printable" (under the field's Properties, General tab).
Then go to Tools - JavaScript - Set Document Actions and under the Document Will Print event enter this code:
var d = new Date();
d.setDate(d.getDate()+5);
this.getField("PrintText").value = "This document is valid until " + util.printd("mm/dd/yyyy", d);
Save the file and you're done!
Copy link to clipboard
Copied
The easiest way of doing it is with a text field. Create such a field and call it "PrintText". Set its visibility to "Hidden but printable" (under the field's Properties, General tab).
Then go to Tools - JavaScript - Set Document Actions and under the Document Will Print event enter this code:
var d = new Date();
d.setDate(d.getDate()+5);
this.getField("PrintText").value = "This document is valid until " + util.printd("mm/dd/yyyy", d);
Save the file and you're done!
Copy link to clipboard
Copied
Hello try67,
thank you for your answer. Will the text field be also able to be put into the footer, so that every single page of the document will have the automatic updated date?
Copy link to clipboard
Copied
Forget about the footer.
You can duplicate the text field so that it appears on all the pages of the file, yes. To do so right-click it in Form Edit mode and select Duplicate Across Pages.