1 Reply Latest reply on Dec 3, 2014 6:39 AM by Stamm

    How to resize a rectangle with an image?

    Stamm Level 1

      Hey,

       

      I am working on a MacBook, for me this combination would be "CMD" + "ALT" + "SHIFT" to resize the Rectangle AND the Image placed inside. How is this possible with Indesign script? I'm working with Javascript.

       

      Thanks really much in advance!!

       

      Best regards

        • 1. Re: How to resize a rectangle with an image?
          Stamm Level 1

          I found a workaround. This is not the proper solution, but it works for me. Note: "Width" and "Height" are the geometric bounds of the page substracted. x2-x1 = width, y2-y1 = height.

           

          newX = width/100*5;

          newY = height/100*5;

          newWidth = width/100*95;

          newHeight = height/100*95;

           

          Then I just added my rectangle like so:

           

          myRectangle = rectangles.add({geometricBounds:[newY, newX, newHeight, newWidth]});

          myRectangle.place(File(myFile));

          myRectangle.graphics[0].fit(FitOptions.proportionally);

          myRectangle.graphics[0].fit(FitOptions.centerContent);