Problems accessing the app.newDoc () application

New Here ,
Feb 05, 2019 Feb 05, 2019

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript

Views

188

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

Have something to add?

Join the conversation