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

Use Javascript to jump to Bookmark

Lextreme
Registered: May 4 2009
Posts: 12

Hi!

I'm trying to find out how I can jump to a specific bookmark with javascript. I want to do this so users can type in a identifier and jump directly to that associated bookmark...

It's probably something easy but I just cannot find it! It's frustrating!

Thanks in advance!

try67
Expert
Registered: Oct 30 2008
Posts: 2398
Once you know which Bookmark you want to go to, use its execute() method.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Lextreme
Registered: May 4 2009
Posts: 12
Do you have an example about how this works? What javascript code do I need to insert if I want to jump to a bookmark with the name PDL002?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Look in the reference file under Bookmark Object - Methods - execute.
There's a sample script there that does exactly that.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Lextreme
Registered: May 4 2009
Posts: 12
Where can I find the reference file? I have the Adobe JS Guide (no sample there), and the Javascript Developer Guide but I still cannot find it... :(
try67
Expert
Registered: Oct 30 2008
Posts: 2398
This is the reference for version 7.0.5:
http://www.adobe.com/devnet/acrobat/pdfs/AcroJS.pdf
It's a bit old, but for your purposes you don't need the newer ones, and also the differences are minor.
The example I mentioned is on pages 167-168.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com