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
Have something to add?