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
1 Correct answer
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.
Copy link to clipboard
Copied
Not possible with Acrobat Reader. You need Adobe Acrobat.
Copy link to clipboard
Copied
Acrobat and Acrobat Reader are two different products. Make sure you know the difference.
Copy link to clipboard
Copied
Apologies for confusion,
I am using Adobe Acrobat Reader DC
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.
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?
Copy link to clipboard
Copied
Use the function GetActiveDoc.
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
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.
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;
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.
Copy link to clipboard
Copied
Have you got the path yet? How to get? help me! Thanks
Copy link to clipboard
Copied
Have you got the path yet? help me!
Copy link to clipboard
Copied
I think the discussions covered it all.
Copy link to clipboard
Copied
But I still don't know how to do it with c#. Help me. Thanks.
Copy link to clipboard
Copied
Which part of the answers are not clear? We would only type it out again, because for us that’s the answer.

