Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Retrieve path of pdf open in Acrobat DC in C#

New Here ,
Dec 29, 2017 Dec 29, 2017

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

TOPICS
Acrobat SDK and JavaScript
6.9K
Translate
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

correct answers 1 Correct answer

LEGEND , Jan 07, 2018 Jan 07, 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.

Translate
Community Expert ,
Dec 29, 2017 Dec 29, 2017

Not possible with Acrobat Reader. You need Adobe Acrobat.

Translate
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
LEGEND ,
Dec 29, 2017 Dec 29, 2017

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

Translate
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
New Here ,
Dec 29, 2017 Dec 29, 2017

Apologies for confusion,

I am using Adobe Acrobat Reader DC

Translate
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
LEGEND ,
Dec 29, 2017 Dec 29, 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.

Translate
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
New Here ,
Jan 01, 2018 Jan 01, 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

Translate
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
Community Expert ,
Jan 02, 2018 Jan 02, 2018

Use the function GetActiveDoc.

Translate
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
New Here ,
Jan 02, 2018 Jan 02, 2018

Yes, I understand I need to  use GetActiveDoc function, but for calling this, I need object of AcroExch.App, in c# I don't want to create new object, instead I want reference to already opened instance.

AcroExch.App

Translate
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
LEGEND ,
Jan 02, 2018 Jan 02, 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.

Translate
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
New Here ,
Jan 05, 2018 Jan 05, 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;

Translate
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
LEGEND ,
Jan 07, 2018 Jan 07, 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.

Translate
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
New Here ,
Jul 12, 2018 Jul 12, 2018

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

Translate
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
New Here ,
Jul 12, 2018 Jul 12, 2018

Have you got the path yet? help me!

Translate
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
LEGEND ,
Jul 13, 2018 Jul 13, 2018

I think the discussions covered it all.

Translate
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
New Here ,
Jul 15, 2018 Jul 15, 2018

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

Translate
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
LEGEND ,
Jul 16, 2018 Jul 16, 2018
LATEST

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

Translate
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