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!)
Use oval, polygon, rectangle property:
autoFit = true;
I figure it out!
I use the transform function instead of the resize function.
pageItem.transform(CoordinateSpaces.INNER_COORDINATES , AnchorPoint.TOP_LEFT_ANCHOR, matrix);
Thank you but I figure it out!