Retrieve path of pdf open in Acrobat DC in C#

New Here ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

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

Views

3.0K

Likes

Translate

Translate

Report

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

Most Valuable Participant , 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.

Likes

Translate

Translate
Adobe Community Professional ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

Not possible with Acrobat Reader. You need Adobe Acrobat.

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Apologies for confusion,

I am using Adobe Acrobat Reader DC

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Dec 29, 2017 Dec 29, 2017

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Jan 02, 2018 Jan 02, 2018

Copy link to clipboard

Copied

Use the function GetActiveDoc.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Jan 02, 2018 Jan 02, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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;

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Jan 07, 2018 Jan 07, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Have you got the path yet? help me!

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Jul 13, 2018 Jul 13, 2018

Copy link to clipboard

Copied

I think the discussions covered it all.

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Jul 16, 2018 Jul 16, 2018

Copy link to clipboard

Copied

LATEST

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

Likes

Translate

Translate

Report

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