auto-fill date

I want to auto-fill a date in a form field using Adobe Acrobat X standard. I have seen how to do this in Pro, but how to do it in standard?

Example: A user opens a form and the "Today's Date" field is auto-populated with the current system date in MM/DD/YYYY format.

Thanks for your time and advice.


Kevin Burel


1 Answer

It does not matter in which Adobe tool the form is displayed, auto-generating a date is the same. It's done with a document level script. The trick is to get the script into the PDF.

I do not have Acrobat X Standard, but I was under the strong impression that you could edit Document Level Scripts with this tool. There should be a "JavaScript" panel under "Tools". If there is then add a new document level script and enter this code.

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

If you cannot edit the doc scripts , then open the console window and run this code.

var cJS = 'this.getField("MyDateField").value = util.printd("mm/dd/yyyy",new Date());';
this.addScript("Init",cJS);

Where "MyDateField" is the name of the field you want to put the date into.

Thom Parker
The source for PDF Scripting Info pdfscripting.com

The Acrobat JavaScript Reference, Use it Early and Often

The most important JavaScript Development tool in Acrobat
The Console Window (Video tutorial)
The Console Window(article)

Having trouble, Why Doesn't my Script Work


Thom Parker   


Please specify a reason: