
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
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.