Get Path of PDF Opened in Acrobat DC Pro

New Here ,
Mar 23, 2018

Copy link to clipboard

Copied

I just wish to retrieve the path of PDF document opened in Acrobat DC Pro, and save paths to my database in c#,

I able to get active pdf document in c# but unable to retrieve path of the document,

Type PDFType = Type.GetTypeFromProgID("AcroExch.App");

CAcroApp AcroAppObj = Activator.CreateInstance(PDFType) as CAcroApp;

CAcroAVDoc AvDocObj = AcroAppObj.GetActiveDoc() as CAcroAVDoc;

CAcroPDDoc PdDocObj = AvDocObj.GetPDDoc() as CAcroPDDoc;

But not getting path of of that document, is there any other way to achieve this?

Help will be much appreciated

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

There isn't a function in the OLE API for acquiring a path, but you can get this information with JavaScript.

Use the PDDoc object to acquire the JSO, and then use it to get the path property.

Dim jso as Object

Dim path as String

jso = gPDDoc.GetJSObject

path = jso.path

TOPICS
Acrobat SDK and JavaScript

Views

400

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

Get Path of PDF Opened in Acrobat DC Pro

New Here ,
Mar 23, 2018

Copy link to clipboard

Copied

I just wish to retrieve the path of PDF document opened in Acrobat DC Pro, and save paths to my database in c#,

I able to get active pdf document in c# but unable to retrieve path of the document,

Type PDFType = Type.GetTypeFromProgID("AcroExch.App");

CAcroApp AcroAppObj = Activator.CreateInstance(PDFType) as CAcroApp;

CAcroAVDoc AvDocObj = AcroAppObj.GetActiveDoc() as CAcroAVDoc;

CAcroPDDoc PdDocObj = AvDocObj.GetPDDoc() as CAcroPDDoc;

But not getting path of of that document, is there any other way to achieve this?

Help will be much appreciated

Adobe Community Professional
Correct answer by Thom Parker | Adobe Community Professional

There isn't a function in the OLE API for acquiring a path, but you can get this information with JavaScript.

Use the PDDoc object to acquire the JSO, and then use it to get the path property.

Dim jso as Object

Dim path as String

jso = gPDDoc.GetJSObject

path = jso.path

TOPICS
Acrobat SDK and JavaScript

Views

401

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
Mar 23, 2018 0
Adobe Community Professional ,
Mar 23, 2018

Copy link to clipboard

Copied

There isn't a function in the OLE API for acquiring a path, but you can get this information with JavaScript.

Use the PDDoc object to acquire the JSO, and then use it to get the path property.

Dim jso as Object

Dim path as String

jso = gPDDoc.GetJSObject

path = jso.path

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
Reply
Loading...
Mar 23, 2018 0
New Here ,
Jul 13, 2018

Copy link to clipboard

Copied

I still can't get the path in c#, how can I do it? 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
Reply
Loading...
Jul 13, 2018 0
Most Valuable Participant ,
Jul 13, 2018

Copy link to clipboard

Copied

We described how to do it. Your question won’t help, since all we could do is repeat what we already said. So please show your code and tell us what goes wrong.

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
Reply
Loading...
Jul 13, 2018 0