Step 1: Check us out

You don't have to be a member to look at any content on the site. Increase your expertise with our helpful tutorials, videos, forums, and sample PDFs.

Step 2: Sign up for a free account

Like what you see? Take the next step and become a member. Register now to get discounts, attend eSeminars, ask questions and more.

Step 3: Start participating

Get the most out of your membership. Post in the forums, create your profile, submit to the gallery, attend a user group meeting. Log In now.

Acrobat User Community Forums

You are not logged in.     Log in to your AUC account.     Don't have an account? Sign up today

#1 2010-02-08 17:19:45

Spleckxa
Member
Registered: 2010-01-06
Posts: 14

Creating "Go to Page" functionality

Hello all,

I was wondering if anybody has a javascript that will allow a person to type in a page number in a form field and have it open a pdf file to that exact page. 

Specifically, I am trying to create a self-contained CD that automatically opens up a pdf file listing all the pdf's contained on the CD.  After each pdf listing, there will be a form field asking which page number of that pdf the user would like to go to.  Once the user types in the page number and hits ENTER, the pdf would open up to the page the user specified.

I've been trying to see if the Run Command parameters or the URL open parameters for pdf's would work, but it looks like this will have to be done via javascript.

Any help would be much appreciated.

Thanks!

David


Offline

 

#2 2010-02-09 03:16:46

try67
Expert

Registered: 2008-10-30
Posts: 1105

Re: Creating "Go to Page" functionality

You can use the keystroke event or the validate event and then use the new value of the field (make sure the field is formatted as a number) to go to the page, like so (this code is not tested, so it might need some tweaking):

Code:

var value = event.value;
if (event.willCommit)
this.pageNum = Number(value) - 1;

Have a look in the reference files for more information about the event object.


Check out my custom-made scripts website: http://try67.blogspot.com

Offline

 

#3 2010-02-09 09:01:11

Spleckxa
Member
Registered: 2010-01-06
Posts: 14

Re: Creating "Go to Page" functionality

Thanks, try67.  You gave me a great starting point work off of.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson