PDF.Rect coordinates

Q:
I am extracting text from a PDF. Using your sample code, I am also
obtaining the XY coordinates of the text.

Dim bbox As Rect = New Rect
element.GetBBox(bbox)
bbox.x1
bbox.x2
bbox.y1
bbox.y2

Which corners do x1,x2,y1 and y2 refer to? (i.e. x1 is the lower right
hand corner, x2 is the upper right hand corner, etc.)

A:

Dim bbox As Rect = New Rect
element.GetBBox(bbox)
bbox.Normalize()
bbox.x1
bbox.x2
bbox.y1
bbox.y2

will return a rectangle where x1,y1 is the lower-left corner and x2,y2
is
the upper-right corner. Please keep in mind that PDF page coordinate
system starts in lower-left corner of the page and is using units
called
points (where 1pt = 1.72 of an inch). Calling Normalize() in the above
snippet ensures that coordinates are converted to this standard format.