Copy link to clipboard
Copied
HI there,
for a specific document, I want to create a macro or action that will auto advance each page after 3 seconds as a presentation once you click on a button that is located oin the first page.
I know thre is a setting in prefenece to Advance every X Seconds. Bit this affactes ALL documents so is not appropraite to my needs.
I know there is an action that can be created under Page Transitions > Auto flip but this will cause the presentation to start right upon loading.
I want to load the document and once I click on a start button, then the presnttaion will begin. I can not seem to figure out how to do this.
Thank
Dave
Copy link to clipboard
Copied
"I know thre is a setting in prefenece to Advance every X Seconds. Bit this affactes ALL documents so is not appropraite to my needs.
I know there is an action that can be created under Page Transitions > Auto flip but this will cause the presentation to start right upon loading."
Don't use the Preferences of your app.
Use the Properties of the document instead, which are available for this document only.
So the auto-advance starts when the doc is in Full-screen mode, and stops when it is not in Full-screen mode (ctrl + L).
Acrobate du PDF, InDesigner et Photoshopographe
Copy link to clipboard
Copied
You can do it by executing this JavaScript code:
var timeout = app.setInterval("if (this.pageNum==this.numPages-1) {app.clearInterval(timeout);}else this.pageNum++;", 3000);
EDIT: Fixed small mistake in the code.
Copy link to clipboard
Copied
The problem with that code is there's no way to stop the thing from advancing. The PDF Page Transitions system only works in full screen mode for that very reason - without the ability to assign hotkeys to escape from the interval timer, the document will become impossible to work with.
It makes more sense to use real transitions, which you can apply to a range of pages (including defining a specific timer for every page) using the doc.setPageTransitions() API call - read the Acrobat SDK for a complete guide to the parameters. Just exclude the first page with the button, then all the trigger script needs to do is enable full-screen mode and advance one page. ESCaping to the UI will stop it.
Copy link to clipboard
Copied
True, but they didn't ask for a way to stop it, so I assumed it was not necessary. I added a condition to stop it when it reaches the last page, although it is possible to make it go in a loop back to page 1, if desired.
Copy link to clipboard
Copied
HI there,
Thanks for the code but Dave_Merchant was correct in his thoughts about a way to stop the code. I just assumed that pushing the ESC key would just stop it. Is there a way to add a code so that code can be stopped and retun to normal view?
Thanks for you help so far!!
Copy link to clipboard
Copied
No, not easily... The only way I can think of is to add a Stop button to each page and make it visible when the script begins to execute.
Copy link to clipboard
Copied
Hmmm... Adding a stop button will not work. I was hoping for a method where the 50 page pdf could switch page by page and if needed can be stopped by pressing a specific key on the keyboard. what about code that if a certain key is pressed it runs a second script that changes the interval to 0? presssing the key again will then rerun the first script?
Copy link to clipboard
Copied
No, that's not possible.
Copy link to clipboard
Copied
"I know thre is a setting in prefenece to Advance every X Seconds. Bit this affactes ALL documents so is not appropraite to my needs.
I know there is an action that can be created under Page Transitions > Auto flip but this will cause the presentation to start right upon loading."
Don't use the Preferences of your app.
Use the Properties of the document instead, which are available for this document only.
So the auto-advance starts when the doc is in Full-screen mode, and stops when it is not in Full-screen mode (ctrl + L).
Acrobate du PDF, InDesigner et Photoshopographe
Copy link to clipboard
Copied
Thanks. This is exactly what I was looking for. Never saw this option within the specific document.
Much appreciated
dave
Copy link to clipboard
Copied
The simplest way of auto-advancing a page I use is:
Open the PDF in Acrobat or Reader
choose Acrobat/Adobe Reader> Preferences> Full Screen and select options to let Acrobat or Reader automatically advance from page to page at a selected interval.
I hope this helps!

