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

Error Digital Signature C# Acrobat Sdk

New Here ,
Jan 24, 2019 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

431

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
community guidelines
Community Expert ,
Jan 24, 2019 Jan 24, 2019

Copy link to clipboard

Copied

LATEST

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.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
community guidelines