Skip to main content
Inspiring
June 6, 2018
Answered

How to add a self-updating date in footer of a PDF with Adobe Acrobat Pro DC?

  • June 6, 2018
  • 3 replies
  • 6086 views

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

This topic has been closed for replies.
Correct answer try67

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!

3 replies

Participant
January 17, 2024

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?

try67
Community Expert
Community Expert
January 17, 2024

Stamps can't be updated once applied, even if they contained fields. You must use a stand-alone text field for it.

AxlZedAuthor
Inspiring
June 6, 2018

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?

try67
Community Expert
Community Expert
June 6, 2018

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.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
June 6, 2018

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!