Skip navigation
jonoliver_ccf
Currently Being Moderated

Is it possible to create a button which goes back to the previous page?

Jun 15, 2012 3:46 AM

Tags: #acrobat #javascript #buttons #navigation #back_button

I would like to create a button which sits within a interactive pdf page that on click will return me to my previously visited page.

As the page will be able to be accessed via numerous other pages the traditional built in Execute menu action is not suitable.

The page which will be displayed (on click of a button) is a series of mattress sizes which i want to be accessable by each bed product in our collection. Once the user has looked at the mattress size guide i want them to be able to return to the bed product that they were looking at originally, without having to then scroll and search.

Is this possible with some javascript trickery?

i found this script:

history.go(-1);

But allas acrobat was not fond of it.

PLEASE HELP!

Thanks in advance.

 
Replies
  • Currently Being Moderated
    Jun 15, 2012 6:53 AM   in reply to jonoliver_ccf

    PDFs are not HTML documents. HTML has no concept of a physical page and PDF only knows a page canvas.

     

    You can access the page number property of the doc object and you can set the page number of the page number of the doc object. The page number in Acrobat JavaScript is zero base, the first page is 0.

     

    To get the page number one uses the following code:

     

    this.pageNum;

     

    To set the page number one uses:

     

    this.pageNum = 0; // goto first page

     

    To goto the next page:

     

    this.pageNum = this.pageNum++ // increment the page number and goto that page

     

    To goto the last page:

     

    this.pageNum = this.numPages--; // decrement the total number of pages

     

    To goto the previous page:

     

    this.pageNum = this.pageNum--; // decrement the page number

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 15, 2012 1:43 PM   in reply to jonoliver_ccf

    With PDFs it is preveious files and not pages like on the web.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points