Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

help with an auto-page advance.

Community Beginner ,
May 07, 2020 May 07, 2020

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

TOPICS
General troubleshooting , How to , PDF forms
10.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
May 08, 2020 May 08, 2020

"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).

 

autoFlip.pngexpand image

 

autoFlip2.pngexpand image


Acrobate du PDF, InDesigner et Photoshopographe

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 07, 2020 May 07, 2020

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 07, 2020 May 07, 2020

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 07, 2020 May 07, 2020

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 08, 2020 May 08, 2020

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!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 08, 2020 May 08, 2020

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 08, 2020 May 08, 2020

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 08, 2020 May 08, 2020

No, that's not possible.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 08, 2020 May 08, 2020

"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).

 

autoFlip.pngexpand image

 

autoFlip2.pngexpand image


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 08, 2020 May 08, 2020
LATEST

Thanks.  This is exactly what I was looking for.  Never saw this option within the specific document.

 

Much appreciated

 

dave

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 08, 2020 May 08, 2020

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!

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines