Skip to main content
Participant
March 26, 2021
Question

How to create date field that automatically displays today's date in Acrobat DC

  • March 26, 2021
  • 2 replies
  • 1221 views

I would like to post a form online for people to download/print. Each time someone opens up the form, I need a date field on the form to automatically populate today's date and for it to be read only. They must be able to print/download the form for themselves. Thier downloaded form should retain the date that populated when they first printed it. However, the original form as posted online should re-populate today's date for any user who opens it. 

 

I have been experimenting with different Javascript solutions I found online, but many are for other versions of Acrobat and I can't get anything to work. Does anyone have a solutation specifically for Acrobat DC 21.0? The more specific, the better. Thanks so much for any advice! 

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
March 26, 2021

Go to Tools - JavaScript - Document JavaScripts and add a new script. Remove all the code that's created by default and add this instead (let's say your field is called "Today"):

 

this.getField("Today").value = util.printd("dd/mm/yyyy", new Date());

 

This will only work in PDF viewers that support scripting, of course.

Inspiring
March 26, 2021

Are they opening and fill file online?

Participant
March 26, 2021

Yes, that's correct.