8 Replies Latest reply on Jan 2, 2009 9:22 AM by (D_Rob)

    ADBC - getting error in Acrobat Pro 7.09

    Level 1
      Get a message in the console: "ReferenceError: ADBC is not defined"  - Javascript is turned on and enabled for menu execution.<br /><br />The code is running as a trusted function in a custom menu item - the menu item IS in the whitelist registry key.<br /><br />Any Ideas as to why Acrobat 7 isn't recognizing the ADBC object in the javascript code?   Thanks - Dave<br /><br />Below is the folder-level javascript code (it's failing at the line to connect via ADBC):<br /><br />app.addMenuItem( {  cName: "SignCertifySave", <br />              cUser: "Sign && Certify", <br />              cParent: "Tools", <br />              cExec: "SignCertifySave();" });<br /><br />SignCertifySave = app.trustedFunction(<br />function()<br />{<br />     // Save the Document As <basename>_SIGNED.PDF, Create a Signature Field and Sign it (invisibly) and Lock Changes<br />   try{<br />     var reversepath=new String (strrev(this.path));<br />     var pathlength=new Number (this.path.length - reversepath.search("[.]")-1);<br />     var origfilename=this.path.substr(0,pathlength)+".PDF";<br />     var newfilename=this.path.substr(0,pathlength)+"_SIGNED.PDF";<br />     var curdate=new Date();<br /><br />     //Check if Token is inserted - if not, abort<br /><br />     //--under construction------------------------------------<br />     //var sechandler=security.getHandler("Adobe.PPKLite",true)<br />     //var DigIDs=sechandler.digitalIDs;<br />     //--debug--<br />     //app.alert(DigIDs.oEndUserSignCert<br />     //--may also need to parse the array   DigIDs.certs<br />     //when done verifying - keep ID info in variable for storage<br />        //in database log entry<br />     //--under construction------------------------------------<br /><br />     this.saveAs({cPath: newfilename , bPromptToOverwrite: true});<br />     var aRect = this.getPageBox( {nPage: 0} );<br />     aRect[0] = 0;<br />     aRect[2] = 0;<br />     aRect[1] = 0;<br />     aRect[3] = 0;<br />     var SigField = this.addField("SignatureField","signature",0,aRect);<br /><br />     //If we want the Sign part (choose reason and signature<br />        //appearance) to appear, change bUI to true<br />     SigField.signatureSign({oInfo: {mdp:"allowNone"},bUI: false});<br />     <br /><br />     //Connect to database and create log entry<br />     var strdsn="CHASign";<br />     var DBconn=ADBC.newConnection(strdsn);<br /><br />     //Check if connected, if not, error<br />     if (DBconn==null)<br />     {<br />          app.alert("Error: Unable to connect to CHASign database.\r\n\r\nSignature Process Cancelled.",1,0,"Unable to Connect to Database");<br />          return;<br />     }<br />     var statement=DBconn.newStatement();<br />     if (statement==null)<br />     {<br />          app.alert("Error: Unable to query CHASign database.\r\n\r\nSignature Process Cancelled.",1,0,"Unable to Query Database");<br />          return;<br />     }<br />     var query='execute dbo.usp_insert_signature_event @OriginalFile="' + origfilename + '",  @SignedFile="' + newfilename + '", @DateTimeSigned="' + curdate + '",  @DigSigKey="UNDER_CONSTRUCTION"';<br />     statement.execute(query);<br /><br />     <br />   } catch (e) { };<br /><br />}<br />);