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

Set document to display with Bookmarks Panel via JavaScript

mvivit
Registered: Nov 5 2008
Posts: 46
Answered

I have some scripts that create PDF docs from several source PDF files. I would like to set the initial view for these documents to open with the Bookmarks Panel open by default, but I can't seem to find the syntax for it. I'd rather not have to run a batch process on all of them if I can do it automatically in JavaScript. I'm using Acrobat Professional 8.1.3. Thanks for any help!

My Product Information:
Acrobat Pro 8.1, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
It can not be done with JavaScript.

It is possible to do this with Batch Processing and links from a web server.

George Kaiser

mvivit
Registered: Nov 5 2008
Posts: 46
Thanks for the quick answer! Is it possible to insert a document-level JavaScript to open the Bookmarks Panel based off and open document event?
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
There is not way for Acrobat JavaScript to do this. There is bookmark object but the properties and methods do not refernce the document page display. And there is doc object, but the only document disply properties are zoom and zoom type.

George Kaiser

mvivit
Registered: Nov 5 2008
Posts: 46
Thanks for all the help! I guess (ideally) I'd love to be able to do everything with batch processing or everything with scripting. Ah well...such is life. Thanks again for the help!
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
It's possible, but undocumented, so the usual caveats apply:

// Show the bookmarks panepane = "B";

This has been around since version 3.02. The values can also be T, N, and F, but don't use F.


George
mvivit
Registered: Nov 5 2008
Posts: 46
Hey, definitely worth a try. Thanks, George!
Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Are they some undocumented code to display Comment and Attachment panels ?

???
Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
George,

I'd tried your tip but I can't see what the "N" is supposed to do : nothing happens...

;-)

(Acrobat 9 Pro)
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
The undocumented 'pane' property of the doc object are:

this.pane = "bookmarks"; // for bookmarks
this.pane = "layers"; // for layers layers
this.pane = "thumbnails"; // for thumbnails
this.pane = "fullscreen"; // full screen

The values can also be abbreviated to the lowest non-common value, first letters or any lenth unique string.

[Edited to add]: The string values are also not case sensative.

George Kaiser

Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Thanks gkaiseril !
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
Merlin wrote:
I'd tried your tip but I can't see what the "N" is supposed to do : nothing happens...
I believe "N" means "none", so if you don't have one of those other panes open, it won't do anything. If the bookmarks pane is open when you execute the statement, it will close.

George
Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
Thanks George
graam
Registered: Aug 18 2010
Posts: 4
Thank you a lot George Kaiser