Element.GetBBox() and rotated pages


I have pages with a rotation of 90 but the coordinates of the GetBBox() function on a line or word object are not rotated.


The documentation of the GetBBox() function says:
The bounding box already accounts for the effects of current transformation matrix (CTM), text matrix, font size,
and other properties in the graphics state.

Anything special I need to do to get the correct x, y, x2, y2 ? 


GetBBox() does not include the effect of Rotate and CropBox attributes in page dictionary.
To apply the effect of page rotation and crop box transform GetBBox() rect with GetDefaultMatrix().

For more info see:



For example:

Rect bbox = …

Matrix2D mtx = page.GetDefaultMatrix();

mtx.Mult(ref bbox.x1, ref bbox.x1);

mtx.Mult(ref bbox.x2, ref bbox.x2);