1 Reply Latest reply on Feb 11, 2013 8:31 AM by Jump_Over

    [JS] Coordinates of table

    RF2009 Level 1

      Hi all

       

      I have been looking at this thread to get started:

      http://forums.adobe.com/message/4147986#4147986

       

      I have been trying to get the coords of a table and I can get close, but I still need some hints.

       

      Starting of with the storyOffset for a table is great.

       

      So, let me set a few scenarios where I run into issues:

       

      a) If the table spans multiple text frames, then I can't get the height of the table (well, I can, but since it spans multiple text frames, I can subtract that value from the storyoffset).

      b) What if the table starts inside a cell.

       

      I'm looking for the exact x and y coordinates.

       

      Thanks in advance,

      Ruvan

        • 1. Re: [JS] Coordinates of table
          Jump_Over Level 5

          Hi,

           

          Since table has no bounds one have to calculate this and it can be as much accurate as his assuming can be accurate.

          Lets assume that there is no keepBaseline property in use.

           

          myTable x0 coordinate is equal to:

          myTable.storyOffset.horizontalOffset;


          myTable y0 coordinate is equal to:

          myTable.cells[0].insertionPoints[0].baseline +

               myTable.cells[0].bottomInset -

               myTable.cells[0].height;


          myTable x1 coordinate is equal to: myTable x0 + myTable.width;

          myTable y1 coordinate is equal to: myTable y0 + SomeRowsSelection.height;

           

          SomeRowsSelection is a part of table or whole table. Depends on it spans to multiple textFrames or not.

           

          Just an idea...

          rgds