3 Replies Latest reply on Mar 15, 2011 11:43 PM by Ten A

    textFrame.frameFittingOptions in indesign cs5

    frekfeng Level 1

      Hi:

         In indesign cs4, it works with textFrame.frameFittingOptions,

         but in indesign cs5 it said: Object does not support the property or method 'frameFittingOptions'

         Does anybody knows what i have to change to let it work in CS5?

         Thanks in advance.

        • 1. Re: textFrame.frameFittingOptions in indesign cs5
          Ten A Adobe Community Professional

          Hi, try below code.

           

          app.activeDocument.selection[0].fit(FitOptions.FRAME_TO_CONTENT);

           

          You can read "fitOptions" in OMV for more detail.

           

           

          Still, we are ALIVE...

           

          Ten wrote

          • 2. Re: textFrame.frameFittingOptions in indesign cs5
            frekfeng Level 1

            How can I set topCrop of frameFittingOptions

            In Indesign CS4

                 textFrame.frameFittingOptions.topCrop = '10'.

            How Can I do this in Indesign CS5?

            • 3. Re: textFrame.frameFittingOptions in indesign cs5
              Ten A Adobe Community Professional

              You have to change frames contentType, when you want to set frameFittingOptions.

               

              textFrames[0].contentType = ContentType.graphicType;

               

              But script system can't detect change objects contentType.
              However, we can use getElements method.

               

              myFrame = app.activeDocument.textFrames.add();
              myFrame.contentType = ContentType.graphicType;
              myFrame.getElements()[0].frameFittingOptions.topCrop = 10;

               

              I think that put image into frame, using rectangle is better way.

               

              //sample, Image placement test
              //crop top and left
              var pageobj = app.activeDocument.pages[0];
              var imgobj = pageobj.rectangles.add();
              imgobj.visibleBounds = [0,0,200,200];
              f = new File ("~/test.eps");
              imgobj.place(f);
              imgobj.frameFittingOptions.leftCrop = 10;
              imgobj.frameFittingOptions.topCrop = 10;
              imgobj.fit(FitOptions.APPLY_FRAME_FITTING_OPTIONS);

               


              Ten wrote