3 Replies Latest reply on Jul 16, 2010 7:23 AM by NEWSVerlag

    [CS3 JS] Wierd pageHeight out of range error

    simon@skemp.co.uk Level 1

      The following script fails with the message that pageHeight is out of range.

       

      with(app.documents[0].documentPreferences){
      pageHeight = "20mm";
      pageWidth = "32mm";
      }

       

      I can manually resize the document to 20mm height without error.

      Also, the script runs if I change pageHeight to a value over 26mm.

       

      There doesn't seem to anthing on the document that should prevent it from resizing.

       

      Does anyone have any clue as to why this is happening? And how do I get around it.

       

      Thanks

        • 1. Re: [CS3 JS] Wierd pageHeight out of range error
          Laubender Adobe Community Professional & MVP

          Hi, Simon!

          Your standard page margins will cause the error. Set your [Standard] page margins to zero when no document is open. Then you will get no error at all. I just tested it.

           

          Uwe

          • 2. Re: [CS3 JS] Wierd pageHeight out of range error
            Marc Autret Level 4

            Margin settings are generally the cause of a page redim failure.

             

            Here's a script to find exactly the width/height limits in a your configuration:

            (Save your document before running!)

             

            var dp = app.documents[0].documentPreferences;

             

            var h = 900;
            var w = 900;

            var hMin=null;
            var wMin = null;

             

            try{
                while(h>0)
                    {
                    dp.pageHeight = h + "pt";
                    h--;
                    }
                }
            catch(ex)
                {
                hMin = h;
                }

             

            try{
                while(w>0)
                    {
                    dp.pageWidth = w + "pt";
                    w--;
                    }
                }
            catch(ex)
                {
                wMin = w;
                }

             

            var msg = "Min. Height: " + hMin + " pt";
            msg += "\nMin. Width: " + wMin + " pt";

             

            alert(msg);

            • 3. Re: [CS3 JS] Wierd pageHeight out of range error
              NEWSVerlag

              Hi guys,

               

              I have the same problem as Simon. The really weird thing is that Uwes tip with the standard page margins didn't help.

               

              It occurs only with one single document, so it has to do something with this document. There are no margins defined in the whole document or in any default setting I can reach without an open document. Although, if I create a new page without a master, it gets the default margins at 12.7mm = 1/2 inch. Could this have anything to do with the problem? Can anyone tell me how I can change this behaviour? It has to do something with the document because in a newly created one id doesn't happen.

               

              Thanks in advance for your help.

              Thomas