We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.
I have a lot of jobs where I need to have the specific size image at the top of an A4 page with 3mm bleed.
Just wondering if it's possible to have a script that i can execute with an image selected on the page and it sizes it to 216mm width, 116.522mm height, and set the Y coordinate to 55.261mm. Also if it could centre the image horizontally to the page that would be great also (don't think this can be done with the x coordinate because it might change depending if its a pages vs spreads layout?).
Any help with this would be greatly appreciated, thanks!
Sorry forgot to mention, if it could fill frame proportionally after the resize that would be great too.
You can set the size and position in the object styles.
Just apply the object style to the image you want.
And scroll down the menu on the left
Select the image frame:
var y = 55.261; var h = 116.522; var w = 216; app.scriptPreferences.measurementUnit = MeasurementUnits.MILLIMETERS; var pw = app.documents.item(0).documentPreferences.pageWidth; app.documents.item(0).selection.geometricBounds = [y, pw-w, y + h, w]; app.documents.item(0).selection.fit(FitOptions.PROPORTIONALLY);
Just wondering if the style route is better as you could tweak the position and all would update.
Does the script do that?
I don’t think you can set a specific x or y position with a style unless the image is anchored in a text flow?
I think it does work. I will have to try tomorrow
Yes, you’re right. I forget about the size and position option, which got added a few versions back, and which I obviously never use.
Thanks Rob. Although it does size and fit the frame correctly, it doesn't move it to the top of the page for me. Did you test it and it worked for you? I'm on CC 2019 so not sure if that's a factor for it not working.
Nevermind, figure out i had to set Y to -3. Then it puts it in the right spot. Thanks Rob!!!