Copy link to clipboard
Copied
Dear All,
I had a requirement to get the geometric bounds for some key terms in texts (Eg. Key words, URL, etc). Is there any possibility to get the geometric bounds for inline texts? If so, kindly let me know.
regards
Masthan
search the "keyword", set textRange,
and creatOutlines(false) method against the textRange.
("false" propety remain original texts objects)
you can get geometricBounds of "keywords" as Polygons
then remove Outlined texts(polygons)
//ex)
var outTxt = app.selection[0].createOutlines (false);
var textBon = outP[0].geometricBounds;
outTxt [0]. remove ();
Copy link to clipboard
Copied
search the "keyword", set textRange,
and creatOutlines(false) method against the textRange.
("false" propety remain original texts objects)
you can get geometricBounds of "keywords" as Polygons
then remove Outlined texts(polygons)
//ex)
var outTxt = app.selection[0].createOutlines (false);
var textBon = outP[0].geometricBounds;
outTxt [0]. remove ();
Copy link to clipboard
Copied
Hi Milligramme,
It works perfect.
Many thanks for your timely help.
regards
Masthan
Copy link to clipboard
Copied
Hi, Masthan
In addition to the createOutlines approach illustrated above by milligramme, you can access to various measurement properties provided by Text objects, especially the horizontalOffset property -- which works on InsertionPoint too. It depends on your needs. createOutlines allows you to get the coordinates of a full bounding box (for each line), but it may have significant performance cost.
@+
Marc
Copy link to clipboard
Copied
Hi Marc,
Many Thanks for you.
regards
Masthan