Skip to main content
aniketb74878072
Participating Frequently
December 29, 2017
Answered

Retrieve path of pdf open in Acrobat DC in C#

  • December 29, 2017
  • 7 replies
  • 7521 views

In c#, I have handle of Acrobat DC process instance running, I simply want to traverse through details of PDF documents that are open in it, and retrieve path of all those PDFs using Acrobat DC SDK (InterApplicationCommunication).

For this to start with I went through SDK documentation and Samples provided along with it, but samples are not working, Acrobat.dll included in references is missing, so I went through process mentioned in documentation to add reference but Unable to find Acrobat.dll at Project -> Add Rerences... -> COM, I had installed Acrobat Reader DC v2018.009.20050

Note: I am using VS2013 or VS2015, both of them giving same problem

This topic has been closed for replies.
Correct answer Test Screen Name

Found it! you have to bridge to JavaScript and use doc.path. See https://acrobatusers.com/tutorials/file-paths-acrobat-javascript  for a discussion of Acrobat paths.

7 replies

Legend
July 16, 2018

Which part of the answers are not clear? We would only type it out again, because for us that’s the answer.

Legend
July 13, 2018

I think the discussions covered it all.

zhiwei123
Participating Frequently
July 16, 2018

But I still don't know how to do it with c#. Help me. Thanks.

aniketb74878072
Participating Frequently
January 5, 2018

One more step closer,

I am able to retrieve

     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;

Test Screen NameCorrect answer
Legend
January 7, 2018

Found it! you have to bridge to JavaScript and use doc.path. See https://acrobatusers.com/tutorials/file-paths-acrobat-javascript  for a discussion of Acrobat paths.

zhiwei123
Participating Frequently
July 13, 2018

Have you got the path yet? How to get? help me! Thanks

Legend
January 2, 2018

To use this API you need to know how to use general COM objects in your chosen language. If you are unsure, you should find example on the web of people who have worked out how to use the AcroExch objects from C#. C# was not a target language when the API was created and Adobe do not provide examples of its use.

Legend
December 30, 2017

Thanks for clearing that up. The Acrobat SDK is mainly a tool to sell Acrobat, not  for people only with Reader. A few of the IAC interfaces using DDE are available for free but nothing to do what you want. You (and each user using any app you make) must license Acrobat.

aniketb74878072
Participating Frequently
January 2, 2018

Thanks for the info,

I had installed Adobe Acrobat DC and now Acrobat.dll is available in C#,

So now, in order to retrieve foremost pdf document open in an Acrobat DC instance using GetActiveDoc,

I wish to retrieve that active instance of Adobe Acrobat DC, how can I achieve this?

GetActiveDoc

Bernd Alheit
Community Expert
Community Expert
January 2, 2018

Use the function GetActiveDoc.

Legend
December 29, 2017

Acrobat and Acrobat Reader are two different products. Make sure you know the difference.

aniketb74878072
Participating Frequently
December 30, 2017

Apologies for confusion,

I am using Adobe Acrobat Reader DC

Bernd Alheit
Community Expert
Community Expert
December 29, 2017

Not possible with Acrobat Reader. You need Adobe Acrobat.