Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

Digital Signature with JavaScript, Appearance won't change

New Here ,
Jul 27, 2016 Jul 27, 2016

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

TOPICS
Acrobat SDK and JavaScript , Windows
5.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , Aug 30, 2018 Aug 30, 2018

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

...
Translate
Guest
Oct 16, 2016 Oct 16, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 19, 2016 Oct 19, 2016

Hi,

Can you please let me know the version of Acrobat/Reader on your machine.

Thanks,

Shakti K

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 19, 2016 Oct 19, 2016

Adobe Acrobat XI Version 11.0.18

Sincerely yours,

Elsa M. Cole, E.I.T.

[personal info. removed by moderator]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 01, 2016 Nov 01, 2016

What’s the status on my support request?

Sincerely yours,

Elsa M. Cole, E.I.T.

[personal info. removed by moderator]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 02, 2016 Nov 02, 2016

These are informal forums not a way to raise support requests.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 30, 2018 Aug 30, 2018
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines