Copy link to clipboard
Copied
I am looking for a way to resize incoming images from a xml export when it is imported it into Indesign.
Some images have for instance a width of 4500 mm on 72 dpi and comes into Indesign at an image size that exceeds the width of the text frame (never to be seen again... overset). We already have made a script that assigns each incoming graphic to a specific object style, based on a script of Laubender, but we are looking for a script that also resizes a graphic container on import.
Is this even possible? (resize/adjust the container size of an incoming graphic on xml import in Indesign, preferably to a size of for instance 160 mm width on import, WITH A SCRIPT)?
thanks
jeroen
Copy link to clipboard
Copied
Hello,
Quick snippet ...
var doc = app.activeDocument;
var mRectangle = doc.xmlElements[0].xmlElements.itemByName("IMAGE").xmlContent.parent;
var mBounds = mRectangle.geometricBounds;
mRectangle.geometricBounds= [mBounds[0], mBounds[1], mBounds[2], mBounds[1]+160];
mRectangle.graphics[0].fit(FitOptions.proportionally);
mRectangle.graphics[0].fit(FitOptions.centerContent);
Regards
Copy link to clipboard
Copied
thank you for your quick answer. I will look into it.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more