How do I get the current date to show in the document and also print?
Hello! This is lengthy but I wanted to try to include all relevant information. I already appreciate that you're here and I hope you can help.
I'm on Windows 7 using Acrobat Pro DC.
I've been Googling all day and trying different things and I can't seem to figure it out.
I want the form to show the current date when the file is opened.
And I also want the current date to print exactly how you see it in the file.
I need to know where to put the JS code (and to verify the one I'm using is correct).
My method:
Open the document
Tools
Prepare form
Place a text box with Text inside
Click All Properties
Now here is where my findings branch off...
1) One method tells me to click on Format then choose Date from the dropdown, then I choose my style, mmmm d, yyyy
I don't know what to do from there.
2) Another method tells me to click on Format then choose Calculate, choose Custom Calculation Script, Edit, then paste JavaScript code.
I've found variations of this code, but this is the one I used:
var myfield=getField("Text");
var date = new Date();
date=util.printd("mmmm d, yyyy", date);
a) And another suggestion was to goto Tools, JavaScript, Document JavaScripts, Add start, use:
this.getField("Today").value = util.printd("mm/dd/yyyy", new Date());
I don't know which method is more "correct" or if I'm even using the correct JS is the correct places.
I want to specify that I want the current date to show on the page when the document is opened. Currently, I cannot see the date on the page.
Any guidance would be greatly appreciated!!
