Skip to main content
zhiwei123
Participating Frequently
Jul 13, 2018 4:05 AM UTC
Question

Retrieve path of pdf open in Acrobat DC in C#!

  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;

Now I have CAcroPDDoc object, but still unable find any library function which returns Path of document, could you please help in this.

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

How can I get this file path? could you please help in this!

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Legend
Jul 13, 2018 1:19 PM UTC

Please read the discussions, which you replied to, and which told you what to do. Don't ask us to type it out again.

Translate
Legend
Jul 13, 2018 8:21 AM UTC

You replied to two discussions which told what do do !!

Translate
zhiwei123
zhiwei123Author
Participating Frequently
Jul 13, 2018 12:05 PM UTC

                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;

                Console.WriteLine(PdDocObj.GetNumPages());

                Console.WriteLine(PdDocObj.GetInfo(PdDocObj.GetFileName()));

                string fileName = PdDocObj.GetFileName();

              

                I can get the file name, but how can I get the full path?

Translate