Copy link to clipboard
Copied
Hey everyone,
I have a lot of fractions (.eps) in my document that i want to "crop" the border, actually change the frame size.
and I want to do it with a shortcut, it that possible?
Before | After |
---|---|
I saw this vídeo but each fraction has a different width and I need to change the frame size width for "-2mm" according to the current width of the fraction.
There's another way? some script ou plugin?...
Thank you so much!
Copy link to clipboard
Copied
Hi - cntrl-alt-c should do this for you once you've placed and selected the image.
Regards,
Malcolm
Copy link to clipboard
Copied
Hey Malcolm, thanks for the answer, but it's more complex than that.
The content inside of the frames, has a natural "white border". The fractions were made in MathType, and if I press Ctrl+alt+c, the frame fit in the content and the white border will still be there.
I'm trying to do an automatic method that change the frame to a specific size, in this case, -2 mm.
Thanks!
Copy link to clipboard
Copied
It could be scripted. Here's a example AppleScript (OSX only), that will loop thru the doc and get all placed EPS files and set their parent frames to 2mm. For a different width change the number in line 1. Without knowing much about your document it's hard to know if you'll run into errors—make sure you test on a copy.
set thewidth to 2
tell application "Adobe InDesign CC 2018"
tell active document
set properties of view preferences to {horizontal measurement units:millimeters, vertical measurement units:millimeters}
repeat with x in all graphics
if class of x is EPS then
tell parent of x
fit given frame to content
set {a, b, c, d} to geometric bounds
set w to d - b
set woffset to (w - thewidth) / 2
set geometric bounds to {a, b + woffset, c, d - woffset}
end tell
end if
end repeat
end tell
end tell
Copy link to clipboard
Copied
Hey Rob, thanks for the answer.
I confess that i have some difficulty to use scripts, I'll study how to execute them and i'll return.
But again, thanks.
Bruno.
Copy link to clipboard
Copied
I just noticed from your post#1 capture your PS is Windows. My script is AppleScript and would only work with OSX
Copy link to clipboard
Copied
Hi Rob,
Bruno, our OP, is saying:
The content inside of the frames, has a natural "white border". The fractions were made in MathType, and if I press Ctrl+alt+c, the frame fit in the content and the white border will still be there.
So a script cannot know where the contents starts and ends by only checking e.g. the BoundingBox property of the PostScript code. At least I think this would not be reliable.
So a script should really render a version of this EPS in PhotoShop with a high enough effective resolution, reads out the drawing pixels, this would be a selection of the contents in PhotoShop and meassures the size of the selection and the position within the overall size of the image. With the numerical results recorded the script will head back to InDesign and will crop the EPS' holding frame to the results gained with PhotoShop.
Regards,
Uwe
Copy link to clipboard
Copied
brunolimax wrote
… The fractions were made in MathType, and if I press Ctrl+alt+c, the frame fit in the content and the white border will still be there.
Hi Bruno,
by using EPS you have no chance to place the visible contents as bounding box.
I guess a script could do it that would open the EPS in PhotoShop, renders the contents to pixels, measures position and size of the virtual rectangle that surrounds all drawing pixels and uses this result to crop the EPS with InDesign.
Best,
Uwe
Copy link to clipboard
Copied
Hey! If i open the .eps in another program, i can't reopen on the mathtype!
Copy link to clipboard
Copied
and I want to do it with a shortcut, it that possible?
And if you wanted to do them individually via an assigned key command this might work when the EPS (not its frame) selected:
set thewidth to 2
tell application "Adobe InDesign CC 2018"
tell active document
set properties of view preferences to {horizontal measurement units:millimeters, vertical measurement units:millimeters}
set s to item 1 of selection
if class of s is EPS then
tell parent of s
fit given frame to content
set {a, b, c, d} to geometric bounds
set w to d - b
set woffset to (w - thewidth) / 2
set geometric bounds to {a, b + woffset, c, d - woffset}
end tell
else
display dialog "Please Select an EPS and not its Frame"
end if
end tell
end tell
Copy link to clipboard
Copied
Hi Bruno,
I would like to know if the steps suggested above worked for you, or the issue still persists.
Kindly update the discussion if you need further assistance with it.
Thanks,
Srishti
Copy link to clipboard
Copied
I am not sure of a shortcut for this. Just a thought...have you tried using text frame options > auto-size? I put the size of the average width of the box -2 mm and it seemed to work OK on my end.
If not, I would try that. If it doesn't work and the script doesn't work then you might be in for a long and manual process of setting them
Copy link to clipboard
Copied
This may not be as "automatic" but why not just copy and paste the image box that is already sized correctly and then replace the previous image with the new one? The size and position would be fairly close but the box frame would already set.