3 Replies Latest reply on Jan 15, 2014 3:52 AM by RuyRamos

    Resizing image (and its frame) and keeping its position and proportions

    RuyRamos Level 1

      Hi everybody,

       

      I'm working on a script that is supposed to export an image in a InDesign document to several different sizes (for web usage).

       

      So, I have the sizes of the output image and I have a placed Image inside the InDesign document.

       

      If I do this manually I do the following:

       

      1. Select the images frame

      2. Hold cmd and resize the frame to the size I want.

      3. JPEG export and I'm done.

       

       

      When I want to do this by script I do the following:

      1. Find the frame I want.

      2. Do the resize = pageItem.resize(CoordinateSpaces.INNER_COORDINATES, AnchorPoint.CENTER_ANCHOR, ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH, [sizes.widthPts, sizes.heightPts]);

      3. Do an export =  pageItem.exportFile(settings.exportFormat, output);

       

      BUT here is the problem. I can't get the resize function to resize the frame AND the image in the same way I do when I do it manually.

       

      Do any of you guys know how to do this? It feels like it should be something easy...

       

       

      Thankful for any help I can get.

       

      (Happy new year!)

       

      Regards,

      Ruy Ramos