6 Replies Latest reply on Aug 30, 2018 9:30 PM by stepan.ilchuk

    Digital Signature with JavaScript, Appearance won't change

    MrYakob Level 1

      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[i]);

       

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