TextBoundsProvider


interface TextBoundsProvider


A provider interface that abstracts the retrieval of text boundary information.

Summary

Public functions

suspend List<RectF>
getTextBoundsBetweenPoints(pageNum: Int, start: PointF, end: PointF)

Asynchronously obtains the rectangular bounds of text between two points on a specific page.

Public functions

getTextBoundsBetweenPoints

suspend fun getTextBoundsBetweenPoints(pageNum: Int, start: PointF, end: PointF): List<RectF>

Asynchronously obtains the rectangular bounds of text between two points on a specific page.

The returned list contains RectF objects representing the boundaries of the text characters found in the range. These rectangles should be provided in PDF coordinates to ensure consistency across different zoom levels and transforms.

Parameters
pageNum: Int

The 0-based index of the page to query.

start: PointF

The starting point of the selection in PDF coordinates.

end: PointF

The end point of the selection in PDF coordinates.

Returns
List<RectF>

A list of RectF representing the visual segments of the selected text. Returns an empty list if no text is found between the specified points.

Throws
Exception

if a failure occurs during extraction