2

Well the title pretty much explains the problem.

I have a InDesign document containing buttons. One of the buttons should go back to the page the user comes from (previous page). So I want to create a var containing the value of the pagenumber on the button on the previous page like this:

var prevPage = this.pageNum;

Then on the button that should get the user back to where he came from add this:

this.pageNum = prevPage;

This works if I do this after the PDF is created. But since this is a time consuming hassle to do every time the client makes corrections I would like to do it in InDesign.

I know I can add an action to the button containing a menu-action "go to previous page". This literally goes through the Acrobat menu and takes you to the previous page.

The problem is that the Acrobat app doesn't have that menu. So the action can't find the menu items and won't work.

I would like to add a script to the button... but seriously wondering if this is possible. I couldn't even find a plugin that does this.

Hope the stack-brothers have a solution.

Interactive
  • 1,474
  • 5
  • 25
  • 57
  • It's possible but I need some clarification. Do you want the button to go to the previous page (go to page 4 if they are on page 5) or the previous page the user was on... as in if they were on page 2 and then use the pages panel to go to page 5 you want the button to take them to page 2. Which is it? – joelgeraci May 30 '17 at 15:41
  • The last option. If the user is on page 2 and clicks to page 5. The return button should take him back to page 2. – Interactive May 31 '17 at 06:25
  • Ok - thanks. Please see my answer below. – joelgeraci May 31 '17 at 15:08

1 Answers1

0

Use the script below for the button action. It to the previous view on the view stack, which is equivalent to clicking the Previous View button on the Acrobat toolbar.

app.goBack();
joelgeraci
  • 4,606
  • 1
  • 12
  • 19
  • Thnx for your answer but I don't see this working yet. If I add it in Acrobat it works on a computer but not in the mobile app. How can I add this in InDesign? If I create a button what kind of action does it need? – Interactive Jun 01 '17 at 06:23
  • It's not going to work in Acrobat for Mobile. The JavaScript for Acrobat Reader Mobile API is extremely limited and "goBack()" isn't one of the methods supported. You can create the button in InDesign but you'll need to insert the script via Acrobat. – joelgeraci Jun 01 '17 at 14:26
  • Yeah. I was afraid of that. Thanks – Interactive Jun 02 '17 at 06:19