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

How to open PDF in existing instance of Acrobat Pro DC through C#

New Here ,
Jan 14, 2018 Jan 14, 2018

Using Acrobat DC SDK in C#, with following code

   

     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;

I am able to get an opened document, How can I open PDF document in this existing instance through C#?

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

Community Expert , Jan 16, 2018 Jan 16, 2018

This is unfortunately the way Acrobat works: You cannot open a new document in a new tab when you use the IAC interface - even when you use the JSObject bridge. The document will always open in it's own window. If you however create a JavaScript function in a folder level script which opens a document, and then call that function from within your IAC based interface, the document will open in a new tab. I struggled with this a few weeks ago and ended up creating a folder level script.

Translate
LEGEND ,
Jan 15, 2018 Jan 15, 2018

This should be in the SDK documentation. Do you have it?

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 15, 2018 Jan 15, 2018

Yes, I refer to, Acrobat DC SDK Documentation for reference, but unable to find any clue over there to open a pdf in running instance of Acrobat Pro 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 ,
Jan 15, 2018 Jan 15, 2018

Does AVDoc.Open do something different to this?

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 15, 2018 Jan 15, 2018

It open document in a new instance, using following code

AvDocObj.Open(pathForDocument, "")

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 15, 2018 Jan 15, 2018

No, there is only one instance of Acrobat. Do you mean it opens a new tab? A new window? This is normal.

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 15, 2018 Jan 15, 2018

It directly opens a new Window, whereas I am expecting to open only a new tab.

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 16, 2018 Jan 16, 2018

Tabs were added only a couple of years ago, but these APIs are over 15 years old. There‘s no specific tab control. Just double checking: you do see tans in this app, right (old Acrobat 2015 does not have tabs)

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 16, 2018 Jan 16, 2018

Ultimately, you wish to say, I can't open doc in existing instance as new tab, opening document will create new instance only.

So, If I wish to open N pdf documents programatically then N Windows will be created, am I correct?

Anyways thanks for the info.

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 16, 2018 Jan 16, 2018

I haven't tried it and, like you, I would expect that if tabs are activated then this would make a new tab. But it does what it does, there are no special controls or API extensions.

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 16, 2018 Jan 16, 2018
LATEST

This is unfortunately the way Acrobat works: You cannot open a new document in a new tab when you use the IAC interface - even when you use the JSObject bridge. The document will always open in it's own window. If you however create a JavaScript function in a folder level script which opens a document, and then call that function from within your IAC based interface, the document will open in a new tab. I struggled with this a few weeks ago and ended up creating a folder level script.

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 16, 2018 Jan 16, 2018

This is not an instance, by the way. Calling it one will hopelessly confuse your chance of support, if any...

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