These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to set Avdoc as ActiveDoc

abhijeetz
Registered: Jul 9 2008
Posts: 11

Hi,

I have multiple AVdoc's are opened.
I want to set the 2 nd AVdoc as active doc but not able to do so...Please suggest.

I can get the active doc by using AcroExchApp.GetActiveDoc().

Thanks
-Abhijeet

My Product Information:
Acrobat Standard 9.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Have you tried using the AcroExch.App.GetAVDoc() function?

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

abhijeetz
Registered: Jul 9 2008
Posts: 11
Hi Thom,

Yes I have tried AcroExchApp.GetAVDoc(1) in my code and got the second AVDoc.
When I try AcroExchApp.SetActiveTool("Select", True) this tool is applied only to first AVDoc and not to second.

I tried to activate the second AVdoc by using the avdoc.BringToFront() but its not making select tool activate in second AVdoc.

Thanking you,
Abhijeet
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Ahh, this is a tricky one. Yes, you have to call "BringToFront()". Acrobat 8 & 9 changed how toolbars for individual document are handled. It used to be that the same tool was selected for all documents, but now each doc has it's own individual setup. So be for making a tool active you have to be sure that the current document is the one you want. There is a delay between the time you call "BringToFront()" and the document actually becomes the active doc. Use a delay and the "getActiveDoc()" function to be sure before calling "SetActiveTool".Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script