3 Replies Latest reply on Jul 16, 2015 1:00 AM by pav55

    measure real page size for every page in listbox

    pav55 Level 1

      hi guys,

      I'm trying to write a script which will list all pages in listbox with 2 additional columns: width and height

      and stuck when trying to get pages bounds for every page in document.

      My result now looks like that:

      pagedimensions.jpg

      script whatever I'm trying to do getting only size of 1st page and populate it to every item.

       

      My code to get page size as above is:

       

      myDoc=app.activeDocument;

      var page = myDoc.pages[0];

      ...

      function myRealHeight(){

          var Pbound = page.bounds; 

          var pH = Pbound[2] - Pbound[0]; 

          var realHeight = [];

          for(j= 0; j< myDoc.pages.length; j ++){

        realHeight.push(pH);   

        }

          return realHeight;

      }

       

      i tryied some different ways but but always returned [Object Page] or above.

      I'm newbie in scripting and if someone could help me will be great.

      thanks

      (let me know if some other parts of code are necessary)