Copy link to clipboard
Copied
I have 1000 similar documents that all need to be signed in the same location on the document on page 1. Is it possible to do so by scripting in Adobe without having to individually open sign and save the document?
Adobe Acrobat Pro. Same location on the same page in all files and digital signature.
Then you can use an Action (Tools - Action Wizard) with the following code:
var sigField = this.addField("Signature1", "signature", 0, [10, 67, 122, 24]);
var mySignatureProfileFilePath = "/C/Users/YOUR_USER_NAME/AppData/Roaming/Adobe/Acrobat/DC/Security/TEST.pfx"; // ADJUST TO ACTUAL FILE PATH ON YOUR COMPUTER
var myPassword = "ABCD1234"; // ADJUST TO ACTUAL PASSWORD FOR THE PROFILE SELECTED ABOVE
var myEngine = security.getHandler( "Adobe.PPKLite");
if (myEngine.login(myPassword, mySignature
...
Copy link to clipboard
Copied
Do the files already contain a digital signature field? If so, does it have the same name in all files?
Copy link to clipboard
Copied
no digital signature field.
Copy link to clipboard
Copied
So the Action should add a digital signature field and then sign it? Should it always appear on the same page and in the same location?
Copy link to clipboard
Copied
Yes, exactly and on the first page and same location in all the pdf files.
Thank you so much for helping out!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
What's the exact version number of the application (You can find it out by going to Help - About Adobe Acrobat)? What's your OS version?
Copy link to clipboard
Copied
Adobe Acrobat Pro DC
Coutinous release version 2022.002.20191 64 bit
OS Version
Edition Windows 10 Business
Version 21H2
OS build 19044.1586
Experience Windows Feature Experience Pack 120.2212.4170.0
Copy link to clipboard
Copied
Then you can use an Action (Tools - Action Wizard) with the following code:
var sigField = this.addField("Signature1", "signature", 0, [10, 67, 122, 24]);
var mySignatureProfileFilePath = "/C/Users/YOUR_USER_NAME/AppData/Roaming/Adobe/Acrobat/DC/Security/TEST.pfx"; // ADJUST TO ACTUAL FILE PATH ON YOUR COMPUTER
var myPassword = "ABCD1234"; // ADJUST TO ACTUAL PASSWORD FOR THE PROFILE SELECTED ABOVE
var myEngine = security.getHandler( "Adobe.PPKLite");
if (myEngine.login(myPassword, mySignatureProfileFilePath))
sigField.signatureSign( myEngine, { password: myPassword});
else app.alert("Error! Could not login to the Security Handler.");
This will add a Signature field to the bottom-left corner of the first page and then sign it using the specified signature profile. However, you might be prompted to save the file manually after doing so... If it's not, add a Save command to your Action, after the command that executes this JS code.
Copy link to clipboard
Copied
hi,
thanks for the code I was able to get the PDF sign but there is an issue after signing the document, if I right-click on the signature field there is an option to clear the signature. sharing the screenshot for your reference.
so can you help me out how to lock the digital signature .
Copy link to clipboard
Copied
Only you can do that... If you open it on another computer it will not appear.
Copy link to clipboard
Copied
Hi, Is it possible to place pfx file/digitally sign the complete set of documents instead of individually signing in each sign field. Also, please share how to add the save command to the action.
Copy link to clipboard
Copied
No, it has to be done one file (and one field) at a time.
And there's a built-in Save command in the Action Wizard you can add, under Save & Export:
Copy link to clipboard
Copied
@try67, I tried using this code, but the signature field was not filled. Maybe I am doing something wrong?
The folder of my certificate is write like this:
"/Z/OneDrive/1. Colibri/0. Contabilidade e Finanças/99. Certificado Digital/2022/Certificate.pfx"
Should I, instead of that, use _ istead of spaces, like this?
"/Z/OneDrive/1._Colibri/0._Contabilidade_e_Finanças/99._Certificado Digital/2022/Certificate.pfx";
I would like to do something similar you indicated, but with a small change:
- I want an invisible signature, not a visible one
- I would like block the document after sign
Could you help me with that?
Copy link to clipboard
Copied
Just to let you know...
I tried also using the _ instead of space, but I still can't load automatically the signature to the filed that was created.
Copy link to clipboard
Copied
@try67 - I am getting the same empty signature field as @sergiolucianojr . I then have to click the signature fill and apply the information manually.
Is the line below supposed to have my specific signature names used instead?
var sigField = this.addField("Signature1", "signature", 0, [10, 67, 122, 24]);
Copy link to clipboard
Copied
Yes, that only adds a blank Signature field. To sign it you must use the signatureSign method of the Field object, with all the required parameters.
Copy link to clipboard
Copied
Hello, i have a similar problem. I want to sign a batch of 12 contrats, each one with 4 pages, and signature (digital certificate) should be on the last page. I want a find the way of only having to enter the signature PIN 1 time (i´m using a card reader). My Adobe version is
Architecture: arm64
Processor: Apple M1
Build: 23.1.20177.0
AGM: 7.0.4
CoolType: 8.2.1
JP2K: 4.0.0.52671
Copy link to clipboard
Copied
No help?