6 Replies Latest reply on Jun 23, 2017 10:21 AM by Joel_Geraci

    Initial page in Open Options

    MarkWalsh Level 4

      Is there a way, via javascript, to determine (and change) the initial page that is set in the Open Options for a document?

       

      I have a script which does a lot of processing of PDF files, and if the initial page is not set to the first page in the open options, I would like to alert the user, and give the option of changing it if needed.

        • 1. Re: Initial page in Open Options
          Joel_Geraci Adobe Community Professional

          You can't change the initial page setting in the PDF via JavaScript. However, you can detect what page the PDF is on when it opens and then alert the user if it's not the first page and allow them to override it. At that point you have a few choices. If you want the PDF to always override the initial view settings, then you'd add a hidden field to the document and store the user selection there. If you want the override to be user specific, then you'd store the selection in the global object.

           

          Your script would look for the setting. If not found, give the user the option to "change" it. If it is found, jump to the first page.

           

          If either of those sounds reasonable, I can provide further help.

          1 person found this helpful
          • 2. Re: Initial page in Open Options
            try67 MVP & Adobe Community Professional

            No, JS has no access to this information.

            1 person found this helpful
            • 3. Re: Initial page in Open Options
              MarkWalsh Level 4

              Thanks, I was afraid of that.

               

              I'm not looking for a script to add within the document, just wanted to be able to let the user know if this document wasn't set to open to page 1. This script resides in an action that is run to do some final checks and processing on these documents to finalize them before they are distributed. Usually, they should be set to the first page, but if it's not, I'd like the user to know so they can determine if there is a reason for this, or it needs to be changed.

               

               

              Thanks for the info.

              • 4. Re: Initial page in Open Options
                Joel_Geraci Adobe Community Professional

                Ok - in that case, I'd create an Acrobat Action something like the "Prepare for Distribution" that uses the action "Document Processing" -> "Set Open Options" first and then "More Tools" -> "Execute JavaScript" for the rest of your checks. Actions can chain processing steps. If the document was set to either the default or already set to page 1, the open options don't really change anything so it doesn't matter what the original setting was.

                • 5. Re: Initial page in Open Options
                  MarkWalsh Level 4

                  I don't want to set the value without verifying it with the person running the action. There may be cases where the initial page is not the first page, and I don't want to override it without verification first.

                  • 6. Re: Initial page in Open Options
                    Joel_Geraci Adobe Community Professional

                    In the action, you can prompt user and pop open the initial view dialog.