Skip to main content
thomasm16477343
Participating Frequently
February 5, 2019
Question

Problems accessing the app.newDoc () application

  • February 5, 2019
  • 0 replies
  • 421 views

Good afternoon.
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

This topic has been closed for replies.