enterTextSelectionMode

open override fun enterTextSelectionMode(@IntRange(from = 0) pageIndex: Int, textRange: Range)

Sets the current text selection. Once you invoke this method, you'll get TextSelectionController (through registered OnTextSelectionModeChangeListener) which provides methods for managing text selection actions.

Parameters

pageIndex

Number of the page on which text selection should be performed. Has to be 0 <= pageIndex < totalPages.

textRange

0-based range spanning the text which should be selected. Range has to be in the interval 0, textLength.

Throws

If pageIndex is not in the page range.


open override fun enterTextSelectionMode(pageIndex: Int, touchedTextRects: TextSelectionRectangles)

Sets the current text selection. Once you invoke this method, you'll get TextSelectionController (through registered OnTextSelectionModeChangeListener) which provides methods for managing text selection actions.

Parameters

pageIndex

Number of the page on which text selection should be performed. Has to be 0 <= pageIndex < totalPages.

touchedTextRects

List of rectangles (in PDF coordinates) under which text selection is to be performed

Throws

If pageIndex is not in the page range, or if text rectangles on page don't contain any of @{code touchedTextRects}.