Can anyone tell me the best way to create a button that when clicked zooms into a photo on the page at a set %. Im creating a furniture catalogue that has 18 small ish photos and I just want the user to click to zoom in and back out again.
Im using indesign and Acrobat 9.
this.zoom = 200;
But getting it right is much more difficult because you need to zoom to a specific location on the page. One easy way to do this, but its not always exact, is to set the focus to a specific element so that that element is centered on the screen. So, place an invisible button over the image and modify the code to this.
this.zoom = 600;
this.getField("image1").setFocus();
Or, if the zoom button is the button that's over the image.
this.zoom = 600;
event.target.setFocus();
And to zoom out do this modification.
if(this.zoom == 600)
this.zoom = 100;
else
{
this.zoom = 600;
event.target.setFocus();
}
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script