Copy link to clipboard
Copied
Hi All,
How do I crop/remove an extra white space around on image in InDesign script? Please see below your reference.
This is possible or not? Please suggest to me, friends
Thanks,
karthik S
Copy link to clipboard
Copied
An image is a graphic file inside a rectangle. You crop the image by changing the geometric bounds of the rectangle. For example, to crop an image by 6 millimeters on all sides, do this (assuming your measurement units are millimeters):
gb = app.selection[0].geometricBounds;
app.selection[0].geometricBounds = [gb[0]+6, gb[1]+6, gb[2]-6, gb[3]-6];
P.
Copy link to clipboard
Copied
Totally agree with the solution that you have provide , please help me with script
I have placed imagefile in rectangular frame having bounds (x=800.524 mm, y=11.194 mm,w=200.003 mm,H=79.153 mm)
Now i want to crop my image (by changing geometric bound of rectangular frame having bound (x=800.524 mm, y=11.194 mm,w=33.35 mm,H=79.153 mm)
Thanks in advance !!
Copy link to clipboard
Copied
Please check https://community.adobe.com/t5/indesign-discussions/cropping-of-image-using-rectangular-frame/m-p/13...
Much appriceated !!
Copy link to clipboard
Copied
geometric bounds are top, left, bottom, and right. So with your data,
gb = app.selection[0].geometricBounds;
app.selection[0].geometricBounds = [
11.194,
800.524,
11.194 + 79.153,
800.524 + 33.35
];
Copy link to clipboard
Copied
Thanks! Perter Kahrel
Also, my main concern, I need to crop for the left and right white space. Please see my screenshot (Please see "Crop" bottom of the left and right text) this type of cropping, I want to do.
This is possible?
Thanks in Advance,
Karthik S
Copy link to clipboard
Copied
Well, sure. Do you know geometricBounds? They are the top, left, bottom and right of a frame, in that order. So if you want to crop left and right, you change the second (left) and fourth (right) values:
app.selection[0].geometricBounds = [gb, gb[1]+6, gb[2], gb[3]-6];
Copy link to clipboard
Copied
One more Thanks! Perter Kahrel
I want to like crop image(this is group image) below: Placed screenshot for your reference.
Thanks,
Karthik S
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I'm pretty sure he / she is looking for an automatic way to crop white space 😉 like you can do in Photoshop when you select around the object 😉 but of course is not possible.