Problems accessing the app.newDoc () application acrobat SDK

0

I am currently creating an application with Acrobat in .Net C #. But I have problems accessing the app.newDoc () function.

c#:

        mApp = new AcroApp();       

        avDoc = new AcroAVDoc();   

      avDoc.Open("C:\\Users\\tmuñoz\\Desktop\\Thuban-Nivel 1.pdf", "");

        pdDoc = (CAcroPDDoc)avDoc.GetPDDoc();         

        object jso;        

        jso = pdDoc.GetJSObject();

        object[] param = new object[2];

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

error:

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

On the other hand, when making a similar code in VB.net, it works for me.

VB.net:

    gPDDoc = CreateObject("AcroExch.PDDoc")

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

    Dim doc As Object

    jso = gPDDoc.GetJSObject()

    doc = jso.app.newDoc()

From what I understand, I am calling the add.newDoc function wrong from c #, if so, I would like you to tell me how it should be the correct way to call it

c#
vb.net
acrobat
acrobat-sdk
asked on Stack Overflow Feb 6, 2019 by Thomas Muñoz • edited Feb 6, 2019 by static_cast

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0