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

bookmark setAction problem

joy_young
Registered: Jul 30 2010
Posts: 1

I know i can set doc.pageNum to make a bookmark work well, but I noticed that the command "Set Destination" of a bookmark's shortcut menu do the same thing in different way. It uses an action with zoom. So, Could anyone please tell me how to use java script to do it like that?

Thanks in advance for answering my question.

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
First, you have to manually define the destination to be used.
// edit following lines for bookmark level and destination name// set bookmark levelvar bmLevel = 0;// set named destination - name between quotation marksvar myNamedDest = "chapter5";//// make no edits below this line!!!//// establish book mark levelvar bm = bookmarkRoot.children[bmLevel];// build action script for going to the named destinationvar cAction = 'this.gotoNamedDest(' + myNamedDest +");" ;// set the bookmark action with the built scriptbm.setAction(cAction);

George Kaiser