4 Replies Latest reply on Aug 28, 2009 2:14 AM by Bernd Alheit

    Force persistent layout / initial view

    JessicaLampe

      Hello @all,

       

      I can set the layout of a pdf document by the doc properties methods, f.e.:

      this.layout = "TwoColumnLeft";

       

      But after saving the active pdf document these settings are lost. :-/

       

      I need a way to make these settings persistent.

      Manuelly this works with the menu "File > Properties > ..."

       

      I think I have to use the app (and not doc) properties. But what is the correct way to define this persistent inital view of the pdf document by JavaScript?

       

      Best wishes

      Jessica

        • 1. Re: Force persistent layout / initial view
          MichaelN Level 3

          Hi Jessica,

           

          I had a similar problem recently. I wanted to make every document open to full page view, and save that setting into the file.

           

          The way I solved it was to create a script that inserts a document Javascript into the PDF.

           

          So, to solve your problem, try:

           

          this.addScript("woColumnLeft", "this.layout = "TwoColumnLeft";);

          • 2. Re: Force persistent layout / initial view
            MichaelN Level 3

            Hi Jessica,

             

            I had a similar problem recently. I wanted to make every document open to full page view, and save that setting into the file.

             

            The way I solved it was to create a script that inserts a document Javascript into the PDF.

             

            So, to solve your problem, try:

             

            this.addScript("TwoColumnLeft", "this.layout = "TwoColumnLeft";);

             

             

            You could incorporate this into a batch sequence.

             

            I do not like batch sequences, so the way I did it was to create a button in the toolbar that does the following to a PDF when clicked:

             

            1. Inserts some metadata into the PDF (title, copyright, author, etc)

            2. Inserts the document Javascript 

             

            this.addScript("Page", "this.zoomType = zoomtype.fitP;");

             

            3. Locks the document

             

            I hope this helps

             

            Michael

            • 3. Re: Force persistent layout / initial view
              JessicaLampe Level 1

              Hi Michael,


              many, many thanks for your answer!


              You are right! If I create a script that inserts a document JavaScript into the PDF, than it works fine.


              But there is a problem:

              If the other user (who would read the pdf) have deactivated the option "Activate JavaScript at startup" in the preferences menu of Acrobat, than the script won't work.

               

              Yes I think also, that's the best way to create a toolbar button or a menu entry (that's my preference) to run the JavaScript (I don't like the batch sequences too).


              But it would be better for me, if there is a way without including a special JavaScript into the document, which is executed by the open process of the pdf document.

               

              Is there another solution without a document JavaScript?

               

              Regards,

              Jessi

              • 4. Re: Force persistent layout / initial view
                Bernd Alheit Adobe Community Professional & MVP

                You can set the initial view in a batch sequence.