Quantcast
Viewing all articles
Browse latest Browse all 73766

How to reference

Hi, I try to sign PDF document with my certificate file. I used code from SDK:

AcroAVDoc g_AVDoc = null;

string pdf = @"C:\Users\myprofile\Desktop\tests\1.pdf";

string pfx = @"C:\Users\myprofile\Desktop\tests\cert.pfx";

string pwd = @"mypwd";

 

g_AVDoc = new AcroAVDoc();

g_AVDoc.Open(pdf, System.IO.Path.GetRandomFileName());

if (pdf != null && g_AVDoc.IsValid())

{

   CAcroPDDoc pdDoc = (CAcroPDDoc)g_AVDoc.GetPDDoc();

   object jso = pdDoc.GetJSObject();

 

   object[] param = new object[1];

   param[0] = pwd;

   object con = jso.GetType().InvokeMember("SetUserPassword", BindingFlags.InvokeMethod, null, jso, param);

 

   param[0] = pfx;

   con = jso.GetType().InvokeMember("SetUserDigitalIDPath", BindingFlags.InvokeMethod, null, jso, param);

 

   param[0] = jso;

   con = jso.GetType().InvokeMember("AddSignature", BindingFlags.InvokeMethod, null, jso, param);

}

 

but I got an error "Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))" on line "object con = jso.GetType().InvokeMember("SetUserPassword", BindingFlags.InvokeMethod, null, jso, param);"

 

I think, the code cannot find a javascript method "SetUserPassword", but I don't know how to provide the file path or how to reference it (I have referenced Adobe Acrobat 9.0 Type Library). Can you help me, please?


Viewing all articles
Browse latest Browse all 73766

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>