Copy link to clipboard
Copied
I am trying to set up a script to certify multiple documents with my hand drawn signature. Everything in the code appears to function correctly except that it won't apply my appearance attribute, instead just applying the default Adobe signature appearance.
Here is the code I am using (personal info omitted for obvious reasons)
/* Add Signature*/
// Validate signatures when the document is opened:
security.validateSignaturesOnOpen = true;
// List all the available signature handlers
for (var i=0; i<security.handlers.length; i++)
console.println(security.handlers);
// Select the Adobe.PPKLite engine with the Acrobat user interface:
var ppklite = security.getHandler(security.PPKLiteHandler, true);
var oParams = {
cPassword: "password",
cDIPath: "/C/Users/user/Desktop/file.pfx" // Digital signature profile
};
ppklite.login(oParams);
var myInfo = {
password: "password",
location: "",
reason: "",
contactInfo: "email",
appearance: "Signature", // This is the part that does not get applied
mdp: "allowNone"
};
// Obtain the signature field object:
var f = this.getField("NameOfSigField");
// Sign the field:
f.signatureSign({
oSig: ppklite,
oInfo: myInfo,
cDIPath: "/C/temp/mySignedFile.pdf",
//cLegalAttest: ""
}); //End of signature
console.println(myInfo.appearance); // This returns "Signature" in the console, so it clearly sees the attribute but does not change it
Had the same issue and spent hours trying different things and finally found a solution on how to set custom appearance on digital signature using JavaScript!
The solution is to set a property to the signature field which would accept only specified named appearance. In your case it would look like this:
f.signatureSetSeedValue({appearanceFilter: "Signature", flags: 256});
"Signature" is the name of your custom appearance setup in the settings, and the flag 256 makes this property mandatory, forcin
...Copy link to clipboard
Copied
I no longer have the script that I was using, but this happened to me every time Adobe was loaded by IT, anD the IT person did not do a "check for updates" after doing the installation. You might want to try this, because your script might be fine.
Copy link to clipboard
Copied
Hi,
Can you please let me know the version of Acrobat/Reader on your machine.
Thanks,
Shakti K
Copy link to clipboard
Copied
Adobe Acrobat XI Version 11.0.18
Sincerely yours,
Elsa M. Cole, E.I.T.
[personal info. removed by moderator]
Copy link to clipboard
Copied
What’s the status on my support request?
Sincerely yours,
Elsa M. Cole, E.I.T.
[personal info. removed by moderator]
Copy link to clipboard
Copied
These are informal forums not a way to raise support requests.
Copy link to clipboard
Copied
Had the same issue and spent hours trying different things and finally found a solution on how to set custom appearance on digital signature using JavaScript!
The solution is to set a property to the signature field which would accept only specified named appearance. In your case it would look like this:
f.signatureSetSeedValue({appearanceFilter: "Signature", flags: 256});
"Signature" is the name of your custom appearance setup in the settings, and the flag 256 makes this property mandatory, forcing exactly this appearance. If appearance under that name is not found, it will throw an error.
You can read more about it in official Acrobat JS API Reference.
Works for Acrobat 9.0 and higher
Find more inspiration, events, and resources on the new Adobe Community
Explore Now