Skip to main content
stewmanfu
Participant
June 7, 2020
Question

Button to take user to random page

  • June 7, 2020
  • 1 reply
  • 1036 views

I am trying to create a set of flashcards to take a user to a random question and then another button to take the user to the answer. I have a PDF document with alternating questions and answers, about 400 pages in total. Any help would be appreciated.

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
June 7, 2020

Use this code in a MouseUp "run a JavaScript" action

 

this.pageNum = Math.round(Math.random()*this.numPages);

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often