Skip to main content
Inspiring
January 7, 2021
Question

Reset Open Options to Use the User's Preferences

  • January 7, 2021
  • 2 replies
  • 633 views

We're creating searchable PDFs via scanning. Part of the process for the project is to run an action in Acrobat Pro to set the open options. The action WAS setting the file to open to page 1 but it's causing a problem when pages are later added to the start these files via a VBA macro via the Acrobat DOM.

 

The problem is that when the macro adds one or more pages to the start of the document, the document "remembers" (for lack of a better term) which page was number 1 when the open options were set. So when the document is later opened it opens to the "old" page 1 instead of the actual first page in the document. This problem also occurs if pages are added to the start manually, not with a macro.

 

Ideally we'd like to fix the Initial View of all the scanned PDF files we've done so far to "reset" the "Open to page" option to use the preferences of the Acrobat session. Is there a way to do that?

 

I didn't see any open options in the scripting model and saw one post that said it couldn't be set via scripting. Can someone confirm that, seems kind of unlikely?

 

Thank you,
Ken

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
January 7, 2021

Remove Set Open Options and add this JavaScript into your Action:

 

this.addScript("MyCode", "this.pageNum = 0;");

 

Acrobate du PDF, InDesigner et Photoshopographe
KenWKAuthor
Inspiring
January 7, 2021

Test Screen: The action sets the open options (including showing thumbnails) from the "Document Processing" section of the Edit Action dialog, as here:

Yes, we could just reset it every time, but these PDFs are for daily record-keeping, hense the time to write code to easily add to them. We certainly don't want the users to have to manually change the settings or even have to run an action everytime we want to add to these PDFs.

 

JR's solution may work, though it wouldn't "fix" the original problem caused by having set the open options to go to page 1 (which later isn't 1 but still gets displayed on open), and I would rather have the documents reset back to the default, i.e. using the preferences in the Acrobat session.

 

It's looking like there is no way to reset this once it's set. We've found that in the action setting the open options if we turn on the "Leave As Is" check box the problem doesn't occur.

As for "fixing" the other files the only thing we've that works is to recreate them. Right clicking the single PDF in Windows Explorer and selecting "Combine Files in Acrobat" then saving over the old files does the trick. Not sure if that helps Mac users.

 

Any other ideas are more than welcome. Thanks for responding guys!

Legend
January 7, 2021

How does the original action set the Open Option? Could you just rerun it (to set the open to go to the new page 1)?