Copy link to clipboard
Copied
Hello. I found that the "page properties" in PDF page thumbnail is prohibited to edit.
I want to insert a auto "current date" in a pdf document, so I follow the guideline shown in the below link to do it.
https://kb.uwec.edu/articles/pdf-forms-inserting-an-automatic-date-field
However, since I cannot edit the page properties, the inserted "current date" can't auto update. Could you please help advise how to enable the "page properties" editing? Thank you.
Did you right-click the page, or did you activate the options menu pictured in the top left of your pages panel without having a page selected? If you want the date to update whenever the document is opened, a document level script would be better than a page action script.
If you set the Signature field to lock all fields when signed it should prevent the script from editing the field, but an error message might appear. Alternatively, you can change the code to check if the field is signed before changing the text field's value. Something like this:
if (this.getField("Signature1").value=="") {
// rest of code
}
Copy link to clipboard
Copied
That's odd, but you shouldn't use the Page Open event for that, anyway. Place the code as a doc-level script, via Document JavaScripts, under Tools - JavaScript.
Copy link to clipboard
Copied
Did you right-click the page, or did you activate the options menu pictured in the top left of your pages panel without having a page selected? If you want the date to update whenever the document is opened, a document level script would be better than a page action script.
Copy link to clipboard
Copied
Good point. It seems from the screenshot they clicked the Options button in the Pages panel. This command only becomes available in that popup menu if a page (or multiple pages) has been selected first.
Copy link to clipboard
Copied
Thank you very much. It works now.
I have one more question. If I added the signature field in the same document, I want to set all fields as "not to update any more" including the date after signed, how can I reach that? Since the date is set to be auto-updated every day (by placing the code as a doc-level script), that has caused another problem I just mentioned. Even the document has been signed, the date still keep updating every day. Does anyone have better idea? I am worrying about I have asked a stupid question...
Copy link to clipboard
Copied
If you set the Signature field to lock all fields when signed it should prevent the script from editing the field, but an error message might appear. Alternatively, you can change the code to check if the field is signed before changing the text field's value. Something like this:
if (this.getField("Signature1").value=="") {
// rest of code
}
Copy link to clipboard
Copied
Thank you.
I tried to replaced the follwoing code and it did work. Great.
var f = this.getField("Today");
var signatureField = this.getField("Signature");
if (!signatureField.value) {
f.value = util.printd("yyyy-mm-dd", new Date());}
else {
f.setAction("Calculate", "event.rc = false;");}