Error Digital Signature C# Acrobat Sdk

Jan 24, 2019

Copy link to clipboard

Copied

Hi.
I am creating an application to sign a pdf from c #.
I am currently having the following problem:

System.Runtime.InteropServices.COMException: 'Nombre desconocido. (Excepción de HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))'

This is the code:

            Type AcrobatCAcroAppType;

            AcrobatCAcroAppType = Type.GetTypeFromProgID("AcroExch.app");

            Acrobat.CAcroApp gapp = (Acrobat.CAcroApp)Activator.CreateInstance(AcrobatCAcroAppType);

            Type AcrobatPDDocType;

            AcrobatPDDocType = Type.GetTypeFromProgID("AcroExch.PDDoc");

            Acrobat.CAcroPDDoc gpddoc = (Acrobat.CAcroPDDoc)Activator.CreateInstance(AcrobatPDDocType);

            object jso;

            if (gpddoc.Open("C:\\Users\\tmuñoz\\Desktop\\PDFs Para firmar\\Thuban-Nivel 2.pdf"))

            {

                jso = gpddoc.GetJSObject();

                object[] param = new object[1];

                param[0] = "C:\\Users\\tmuñoz\\Desktop\\ThomasMuñoz.pfx";

                object con = jso.GetType().InvokeMember("SetUserDigitalIDPath",

                BindingFlags.InvokeMethod, null, jso, param);

                param[0] = "testpassword";

                con = jso.GetType().InvokeMember("SetUserPassword",

                BindingFlags.InvokeMethod, null, jso, param);

                param[0] = jso;

                con = jso.GetType().InvokeMember("AddSignature",

                BindingFlags.InvokeMethod, null, jso, param);

            }

I think the error comes from not finding these functions in the JSO object.
From what I understand these are the sdkAddSignature file.
So I guess I should integrate it into the C # project, but I do not know how to do it.

TOPICS
Acrobat SDK and JavaScript

Views

199

Likes

Translate

Translate

Report

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

Error Digital Signature C# Acrobat Sdk

Jan 24, 2019

Copy link to clipboard

Copied

Hi.
I am creating an application to sign a pdf from c #.
I am currently having the following problem:

System.Runtime.InteropServices.COMException: 'Nombre desconocido. (Excepción de HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))'

This is the code:

            Type AcrobatCAcroAppType;

            AcrobatCAcroAppType = Type.GetTypeFromProgID("AcroExch.app");

            Acrobat.CAcroApp gapp = (Acrobat.CAcroApp)Activator.CreateInstance(AcrobatCAcroAppType);

            Type AcrobatPDDocType;

            AcrobatPDDocType = Type.GetTypeFromProgID("AcroExch.PDDoc");

            Acrobat.CAcroPDDoc gpddoc = (Acrobat.CAcroPDDoc)Activator.CreateInstance(AcrobatPDDocType);

            object jso;

            if (gpddoc.Open("C:\\Users\\tmuñoz\\Desktop\\PDFs Para firmar\\Thuban-Nivel 2.pdf"))

            {

                jso = gpddoc.GetJSObject();

                object[] param = new object[1];

                param[0] = "C:\\Users\\tmuñoz\\Desktop\\ThomasMuñoz.pfx";

                object con = jso.GetType().InvokeMember("SetUserDigitalIDPath",

                BindingFlags.InvokeMethod, null, jso, param);

                param[0] = "testpassword";

                con = jso.GetType().InvokeMember("SetUserPassword",

                BindingFlags.InvokeMethod, null, jso, param);

                param[0] = jso;

                con = jso.GetType().InvokeMember("AddSignature",

                BindingFlags.InvokeMethod, null, jso, param);

            }

I think the error comes from not finding these functions in the JSO object.
From what I understand these are the sdkAddSignature file.
So I guess I should integrate it into the C # project, but I do not know how to do it.

TOPICS
Acrobat SDK and JavaScript

Views

200

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 24, 2019 0
Adobe Community Professional ,
Jan 24, 2019

Copy link to clipboard

Copied

What happens when you run the same JavaScript from the console window? This has to work first, before you can do it from the IAC. 

There are many issues related to translating between .Net objects and JavaScript objects. It's best to avoid them as much as possible by writing all the JS as a folder level function, then calling the function from the IAC.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jan 24, 2019 1