5 Replies Latest reply on Jul 31, 2010 2:22 AM by PankChat

    Geometric bounds are not changing

    PankChat Level 1

      Hello all,

       

      This seems to be simple problem and I did such calculation hundreds of times earlier but somehow I am not able to figure it out this time.

       

      I am trying to increase the width of text frame (basically lies on Spine of cover/gutter) I am able to do everything but not able to figure out why the difference I am adding to geometricBounds are not effecting. Below is snippet I've written:

       

       

      Note: spine_width is the value I am getting from the XML Element and is bigger then the spine2width in this case

       

       

      myDoc.zeroPoint = Array(0,0)
      with (myDoc.viewPreferences)
                  {
                      var myOldXUnits = horizontalMeasurementUnits;
                      var myOldYUnits = verticalMeasurementUnits;
                      horizontalMeasurementUnits = MeasurementUnits.millimeters;
                      verticalMeasurementUnits = MeasurementUnits.millimeters;   
      }

       

      var mySpine2_frame=myDoc.pages.item(0).textFrames.item("spine2");

      var spine2bounds=mySpine2_frame.geometricBounds;

      //Calculate width of textFrame

       

      var spine2width=spine2bounds[3]-spine2bounds[1];

      if (spine_width>spine2width)

      {

      var spine2diff=(spine_width-spine2width)/2;

      $.writeln("spine2diff is :"+spine2diff);//Outputs 0.500000

      spine2bounds[3]+spine2diff;

      spine2bounds[1]+spine2diff;

      //Nothing changes here

      mySpine2_frame.geometricBounds=spine2bounds;

       

      I even tried to hardcore the addition to Bounds like spine2bounds[1]+5;
      Though nothing changes here too.

       

      I am sure I am missing something here.

       

      Any thoughts please.

      TIA,

      Pankaj