Copy link to clipboard
Copied
I know how to create a text field, but I do not know how to indicate to automatically fill the text field with "PRINTED ON (today's date)" whenever someone prints the file they opened from the server. I used to have a javascript text field that did this and I could paste it at the top of every required PDF, but it hasn't worked in a long time. My boss wants this feature back, and I just don't see how to do it.
Note that this needs to be done at the PDF level, it cannot be done by changing printer settings to include the current date. Only certain documents need to do this no matter who opens them.
I want to add the text field with this information to the particular files that need to do this. The people who have asked this in the past seem to have been asking for older versions of adobe and their solutions are not applicable. We use Adobe acrobat pro continuous release version 2024.002.20965 64 bit.
I would really appreciate help with this, thank you.
Copy link to clipboard
Copied
Create text field in which you want to show date, name it "Today's Date", format it to desired date format and then as document action, 'Document Will Print' use this script:
this.getField("Today's Date").value = new Date();
Copy link to clipboard
Copied
If your field is named "PRINTED ON" then add that name to the script like this:
this.getField("PRINTED ON").value = new Date();
You can find document actions by selecting 'Prepare form' tool, click on 'More' then scroll down and select 'Document Actions' there select 'Document Will Print', click on 'Edit' and paste script inside.
Copy link to clipboard
Copied
Create text field in which you want to show date, name it "Today's Date", format it to desired date format and then as document action, 'Document Will Print' use this script:
this.getField("Today's Date").value = new Date();
Copy link to clipboard
Copied
Hello Nesa 🙂
I am having trouble following this.
I created the text field. I named it PRINTED ON
"Format it to desired date format".
(My desired date format is mm/dd/yyyy. What do you mean by "it"? Where would I put this information?)
Then as document action, "Document Will Print"...
(Under Document action, there is nothing that says that, it asks me to select a trigger and to select the action. See actions trigger screenshot. and actions select screenshot)
... use this script: this.getField("Today's Date").value = new Date();
(Use it where? Do I select run a javascript? I tried that but the trigger is the issue... I dont want a date that a person can select at the top of the page, I want it to automatically print with no input from the person doing the printing.)
Thank you for your help.
Copy link to clipboard
Copied
No actions are needed under the field. Only the Will Print action.
Set the field's appearance to "Hidden but printable" and the user won't be able to edit its value.
Copy link to clipboard
Copied
If your field is named "PRINTED ON" then add that name to the script like this:
this.getField("PRINTED ON").value = new Date();
You can find document actions by selecting 'Prepare form' tool, click on 'More' then scroll down and select 'Document Actions' there select 'Document Will Print', click on 'Edit' and paste script inside.
Copy link to clipboard
Copied
This post is the key for me! Now I understand where this is. (It is pretty different than the forms setup multiple adobes ago haha.) Thank you very much for your help.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now