Copy link to clipboard
Copied
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#?
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.
Copy link to clipboard
Copied
This should be in the SDK documentation. Do you have it?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Does AVDoc.Open do something different to this?
Copy link to clipboard
Copied
It open document in a new instance, using following code
AvDocObj.Open(pathForDocument, "")
Copy link to clipboard
Copied
No, there is only one instance of Acrobat. Do you mean it opens a new tab? A new window? This is normal.
Copy link to clipboard
Copied
It directly opens a new Window, whereas I am expecting to open only a new tab.
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
This is not an instance, by the way. Calling it one will hopelessly confuse your chance of support, if any...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now