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

Window control with JavaScript?

asmohr
Registered: Sep 2 2007
Posts: 25

Is is possible to use JavaScript to control the sizes and positions of windows for two files in Acrobat Reader?

My Product Information:
Acrobat Pro 6.0.5, Windows
pddesigner
Registered: Jul 9 2006
Posts: 858
I assume you want to have two PDF files opened at the same time.

Click this link and review the JavaScripts in this reference manual.

[url=http://wl.filegenie.com/~pdfmaker/PDFOpenParameters.pdf]http://wl.filegenie.com/~pdfmaker/PDFOpenParameters.pdf[/url]

My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Acrobat JS has several doc object properties for controling how a single PDF is displayed (zoom, zoomType, viewState, and layout). Unfortunately there aren't any parameters for controling how two docs are layed out on the screen.

But there is a way. You can use the "app.execMenuItem" function to call the menu items that control page layout.

You can download a menu item listing tool from

[url=http://www.windjack.com/products/freestuff.php]http://www.windjack.com/products/freestuff.php[/url]

but here are a couple of examples

app.execMenuItem("TileHorizontal");
app.execMenuItem("TileVertical");
app.execMenuItem("Cascade");

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

asmohr
Registered: Sep 2 2007
Posts: 25
Eugene and Thom,

Thanks for the pointers. I posted a longer version of my question in the JavaScript forum that explains the larger context of what I'm working on. .

I don't want to open both docs at once because that would mean distributing a script to do that. I would prefer to have one doc open the other. I can do that with a Link or a Button in the doc, but in those cases I cannot add any Open Parameters.

app.execMenuItem seems to do it. I can stack functions under the same Link or Button; the first opens the doc, the second sets the Tile Vertical layout.

Just last night I found doc.innerAppWindowRect and doc.outerDocWindowRect. I wish I could use innerAppWindowRect to get the current space available and then with a little arithmetic figure out how to reset outerDocWindowRect for each document to postition them the way I want. Unfortunately, those properties are listed with an Access code of "R".

Thanks for your help,
August Mohr