3 Replies Latest reply on Sep 20, 2016 7:09 AM by sreekarthik.k@gmail.com

    Measure major and minor column

    Level 1

      I need to measure the major and minor column width via script

       

      my document have two columns one is major and another one is minor but the while measure the columns via script it shows same value for both columns

       

      How to find the width of major and minor columns

          

       

           var myDoc = app.activeDocument;   

          var myDocPage = myDoc.pages[6];

          var colGutter = myDocPage.marginPreferences.columnGutter;

          var pageBounds = myDocPage .bounds;

          var colCount = myDocPage.marginPreferences.columnCount;

          var pageWidth = (pageBounds[3] - pageBounds[1]) - (myDocPage.marginPreferences.left) - (myDocPage.marginPreferences.right);

          var pageHeight = (pageBounds[2] - pageBounds[0]) - (myDocPage.marginPreferences.top) - (myDocPage.marginPreferences.bottom);

          var colWidth = (pageWidth - colGutter ) / colCount;

              alert (colWidth )

       

      Its working if both columns are same size. if the document having major and minor column how to measure the values please advice.

        • 1. Re: Measure major and minor column
          Sajeev Sridharan Level 4

          Try this,

           

          var myDoc = app.activeDocument;   
          with(myDoc.viewPreferences) {
              horizontalMeasurementUnits = MeasurementUnits.points;
              verticalMeasurementUnits = MeasurementUnits.points;
              rulerOrigin = RulerOrigin.pageOrigin;
          }
          var myDocPage = myDoc.pages[6];
          var colGutter = myDocPage.marginPreferences.columnGutter;
          var pageBounds = myDocPage.bounds;
          var colCount = myDocPage.marginPreferences.columnCount;
          var pageWidth = (pageBounds[3] - pageBounds[1]) - (myDocPage.marginPreferences.left) - (myDocPage.marginPreferences.right);
          var pageHeight = (pageBounds[2] - pageBounds[0]) - (myDocPage.marginPreferences.top) - (myDocPage.marginPreferences.bottom);
          var colWidth1 = myDocPage.marginPreferences.columnsPositions[2] - myDocPage.marginPreferences.columnsPositions[0] - myDocPage.marginPreferences.columnGutter;
          var colWidth2 = myDocPage.marginPreferences.columnsPositions[3] - myDocPage.marginPreferences.columnsPositions[1] - myDocPage.marginPreferences.columnGutter;
          alert (colWidth1)
          alert (colWidth2)
          
          1 person found this helpful
          • 3. Re: Measure major and minor column
            Level 1

            I needs to find the major and minor column position in a page. some document have inside minor column and another have outside minor columns

             

            How to find the major and minor column position in a page