Frequently Asked Question:
How can I get a bounding box (coordinates) for a text object?
How can I get a bounding box (coordinates) for a text object?
The GetPageText function can be used to retrieve the bounding box of a text object. The parameters for this function let you choose ExtractOptions, if you choose option 3, then the function will return a CSV string for each piece of text on the page with the following format:
Font Name, Text Color, Text Size, X1, Y1, X2, Y2, X3, Y3, X4, Y4, Text
The coordinates belong to the following corners of a rectangle:
X1, Y1 = bottom left
X2, Y2 = bottom right
X3, Y3 = top right
X4, Y4 = top left
The co-ordinates are the four points bounding the text, measured using the units set with the SetMeasurementUnits function and the origin set with the SetOrigin function.