4 Replies Latest reply on Feb 6, 2015 5:08 AM by Laubender

    [ID CC, JS] textFrame.fit() doesn’t work

    tobias.wantzen

      Hello,

       

      I’ve no idea, why the .fit() option doesn’t work. Can someone please assist!

       

      This is the starting point: The script duplicates an object (text frame) on a specific master page (where some object reside, which are used throughout the publication) and moves it to the actual page. There it is filled with XML data and should be fitted FRAME_TO_CONTENT:

       

      [...]
      
      _toptitleFrame = duplicateIT ("label", _currPageSpread, _labelledDEFsItems, _dok);
      _theNode.xmlElements.itemByName("label").placeXML(_toptitleFrame);
      _toptitleFrame.fit(FitOptions.FRAME_TO_CONTENT);
      _toptitleFrame.move([(213-(_toptitleFrame.geometricBounds[3]-_toptitleFrame.geometricBounds[1])), 12.7]);
      
      [...]
      
      
      function duplicateIT (_pageItemName, _moveToPage, _labelledDEFsItems, _dok) {
        [...]
        _theImg = _pageItem.duplicate(_pageMaster);
        _theImg.move(_moveToPage); 
          return _theImg;
      }
      

       

      Actually the _toptitleFrame.move works perfectly, but the _toptitleFrame.fit(...) doesn’t work at all. When I command »fit content« in the UI it works perfectly.

       

      Any ideas?

       

      Thanks

      Tobias