I have a document with thousands of hyperlinks to internal destinations. These are not at the top of a page but can be anywhere on the page. The document has a two page layout by default because of a series of pictures that span two pages. I want the links from the two page spreads to lead to a zoomed in view at the destination.
How can I use scripting to change all of the hyperlinks to behave this way?
I have been searching around and putting together code from various places. Here is what I have so far:
for ( var linkPage = 10; linkPage < this.numPages; linkPage++) // loop through each page { var box = this.getPageBox("Crop", linkPage); // get the page box var linksList = this.getLinks(linkPage, box); // get the link if linksList > 0 { for (var i=0; i < linksList.length; i++) // loop through each link { this.zoom = 150; // set zoom to 150% this.gotoNamedDest(linksList[i]); // go to current destination var destPage=this.pageNum linkslist[i].setaction("this.pageNum="+destPage) //set new destination } } }
Will this set the destination to the current location or to the top of that page? If it doesn't work, how can I set it so that it will display the destination at 150%?
One of the problems is that my manager wants it to work so that when a link is clicked, it takes you to the destination, but the [b]Previous View[/b] button will return you to the two page layout with one click. My current attempts have made it into two or more clicks. If two is the minimum, he'll just have to live with it.
Thanks,
ShaunP
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com