TextBoundsProvider


public interface TextBoundsProvider


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

Summary

Public methods

abstract @NonNull List<@NonNull RectF>
getTextBoundsBetweenPoints(
    int pageNum,
    @NonNull PointF start,
    @NonNull PointF end
)

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

Public methods

getTextBoundsBetweenPoints

abstract @NonNull List<@NonNull RectFgetTextBoundsBetweenPoints(
    int pageNum,
    @NonNull PointF start,
    @NonNull PointF end
)

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
int pageNum

The 0-based index of the page to query.

@NonNull PointF start

The starting point of the selection in PDF coordinates.

@NonNull PointF end

The end point of the selection in PDF coordinates.

Returns
@NonNull List<@NonNull 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