extractText

fun extractText(pageIndex: Int, rect: RectF): String?

Extract unicode text within a rectangular boundary on the page. If the buffer is too small, as much text as will fit is copied into it.

Return

If buffer is NULL or buflen is zero, return number of characters (not bytes) of text present within the rectangle, excluding a terminating NUL.

Generally you should pass a buffer at least one larger than this if you want a terminating NUL, which will be provided if space is available. Otherwise, return number of characters copied into the buffer, including the terminating NUL when space for it is available.

Parameters

pageIndex

index of page.

rect

the text rectangle to extract.