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.
Copy link to clipboard
Copied
I have the same issue 'sort of'. Up until the time that I needed to update the current stamp I was using, I had it formatted so that the current date would appear at the top of an approval stamp each time I used it to approve invoices. After adding more text to the stamp and saving it in the same way using the Dynamic stamp type. Yet the only date that shows up is the one of the day in which I edited it and does not change.
Here is the code I was using to accomplish this, which was working fine, unil it didn't:
event.value = util.printd("mmm dd yyyy", new Date);
Thoughts?
Copy link to clipboard
Copied
Stamps can't be updated once applied, even if they contained fields. You must use a stand-alone text field for it.