Copy link to clipboard
Copied
Hi,
BACKGROUND:
I am using an Action Wizard in Adobe Acrobat Pro DC to automatically label a batch of pdf's. It has various steps: JavaScript (Initial Error Trapping) > Remove Hidden Information > Reduce File Size > Save to "Prepped" Folder > Add Header & Footer > JaveScript (Adding incremental labels to all documents in "Prepped" Folder so if there are 4 documents, it will label them in sequence as EX01, EX02, EX03, and EX04).
REQUEST:
1) I need to bring up an error message for the user when a signed pdf is detected in the batch b/c once we upgraded to Adobe Acrobat Pro DC, such files are skipped and therefore, not processed. I researched this and found it is b/c a signature in the pdf makes it so "Changing the Document" is not allowed.
Note: In my example, Document 3 is the signed pdf and all the processing steps above are skipped and the file is not saved in the "Prepped" folder.
I tried the following to alert the user of a signed pdf but it did not work.
if (securityhandler == null) {app.alert(event.target.documentFileName + " is signed and cannot be labeled. It will be skipped.");}
2) As an added bonus, it would be great if you could give me an idea on how I can up the numbering by one once a signed pdf is detected (Can I just add "+1" to the iteration of "global.iteration++"?). Right now, the signed document is skipped and the next document gets assigned its number such that the numbering is off.
Note: In my example, Document 3 is the signed pdf and all the processing steps above are skipped and the file is not saved in the "Prepped" folder. Document 4 instead is labeled as EX03 instead of EX04.
Thanks so much!
Sue
Try it with this code:
var isSigned = false;
for (var i=0; i<this.numFields; i++) {
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if (f==null) continue;
if (f.type=="signature" && f.value!="") {isSigned = true; break;}
}
if (isSigned) app.alert("This document is signed.");
The securityHandler property is for document encryption, not for signatures.
Copy link to clipboard
Copied
"I don't know how to deploy this in my action wizard. Can you advise?"
1.
2.
3.