getCharIndexAt

abstract fun getCharIndexAt(@IntRange(from = 0) pageIndex: Int, x: Float, y: Float): Int

Return the index of the closest character whose rect intersects the given x and y coordinates.

Return

The index of the selected character (zero indexed) or -1 if no character was found at the given coordinates.

Parameters

pageIndex

Page number of the page, zero indexed.

x

X coordinate in PDF point units (usually 1/72 of an inch).

y

Y coordinate in PDF point units (usually 1/72 of an inch).