How to use Javascript to detect a signed Acrobat document?
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
