0

I have process handle of Adobe Acrobat Pro DC process instance running, how can I get AcroExch.App object using process handle in C#.

Aniket Bhansali
  • 630
  • 12
  • 33
  • Worked quiet long time for it, but unable to find a solution for it, For word, I simply use `System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application")` but unable to find solution for this. – Aniket Bhansali Jan 03 '18 at 12:35
  • I tried this with, _Acrobat.Document.DC_ and _AcroExch.Document.DC_ but no success, Is there any other way to retrieve COM Object from ROT and cast it to AcroExch.App. – Aniket Bhansali Jan 04 '18 at 05:45

1 Answers1

0

Please note that, Unfortunately, Acrobat DC SDK, works only with either Adobe Acrobat Pro/Standard version. Doesn't support Acrobat Reader DC.

So, I managed to retrieve reference pointing running instance of Acrobat Pro DC using following piece of code,

Type PDFType = Type.GetTypeFromProgID("AcroExch.App");
CAcroApp AcroAppObj = Activator.CreateInstance(PDFType) as CAcroApp;

AcroAppObj.Show();
CAcroAVDoc AvDocObj = AcroAppObj.GetActiveDoc() as CAcroAVDoc;

CAcroPDDoc PdDocObj = AvDocObj.GetPDDoc() as CAcroPDDoc;

string fileName = PdDocObj.GetFileName();
Aniket Bhansali
  • 630
  • 12
  • 33