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

Changing Bookmark Actions

sstalberg
Registered: Jul 17 2008
Posts: 2

I have a PDF file with numerous bookmarks. Some bookmarks go to a Destination Name; others go to a specific page number. For the bookmarks that go to a specific page number, I need to change the Zoom Level to "Inherit Zoom." Any help on how to achieve this, I assume via Javascript, is appreciated.

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
If the bookmark action was set by selecting the "Set Destination" item from the Bookmarks manu. Then it's action is a "goto" unnamed destination. Unfortuantely, you can't change any of the destination properties from the Acrobat user interface, or with an additional JavaScript action.

For custom navigation you'll have to delete the existing bookmark action and use a "Run a JavaScript" action. One way to do this is to set the zoom type to "no vary" and page number, in that order
   this.zoomType = zoomType.none;this.pageNum = 3;  // to goto page 4

There is another property, added in Acrobat 7, that provides more flexibility. The "doc.viewState" object. It contains all of the view parameters. Of course they are all undocumented. But you can experiment to get what you need. To see what's in there run this line of code from the console window.

this.veiwState.toSource();

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/]http://www.adobe.com/devnet/acrobat/[/url]

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