TextBlock

Represents a text located on a document page. This model contains the actual text the range (i.e. the start and end index of the text on the page), and a list of pageRects holding the PDF coordinates of the text.

Properties

Link copied to clipboard
Annotation that contains the text.
Link copied to clipboard
@IntRange(from = 0)
val pageIndex: Int
Number of the page that this text block resides on.
Link copied to clipboard
PDF rects represented by this text block.
Link copied to clipboard
Actual text range (i.e.
Link copied to clipboard
The represented string on the document.

Functions

Link copied to clipboard
open fun compareTo(@NonNull another: TextBlock): Int
Link copied to clipboard
open fun create(@NonNull document: PdfDocument, @NonNull annotation: Annotation, @NonNull range: Range): TextBlock
Creates TextBlock from textual annotation.
open fun create(@NonNull document: PdfDocument, @IntRange(from = 0) pageIndex: Int, @NonNull range: Range): TextBlock
open fun create(@IntRange(from = 0) pageIndex: Int, @NonNull range: Range, @NonNull pageRects: List<RectF>, @NonNull text: String): TextBlock
Creates a TextBlock from the given page.
Link copied to clipboard
open fun getTextForBlocks(@NonNull document: PdfDocument, @NonNull textBlocks: List<TextBlock>): String
Returns page text for a list of text blocks.
Link copied to clipboard
open fun toString(): String