java.lang.Object | |
↳ | com.pspdfkit.datastructures.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.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public final Annotation | annotation | Annotation that contains the text. | |||||||||
public final int | pageIndex | Number of the page that this text block resides on. | |||||||||
public final List<RectF> | pageRects | PDF rects represented by this text block. | |||||||||
public final Range | range | Actual text range (i.e. | |||||||||
public final String | text | The represented string on the document. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | compareTo(TextBlock another) | ||||||||||
static TextBlock |
create(PdfDocument document, Annotation annotation, Range range)
Creates
TextBlock from textual annotation. | ||||||||||
static TextBlock |
create(PdfDocument document, int pageIndex, Range range)
Creates a
TextBlock from the given page. | ||||||||||
static TextBlock |
create(int pageIndex, Range range, List<RectF> pageRects, String text)
Creates a
TextBlock from the given page. | ||||||||||
static String |
getTextForBlocks(PdfDocument document, List<TextBlock> textBlocks)
Returns page text for a list of text blocks.
| ||||||||||
String | toString() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Annotation that contains the text. Valid only when text block resides in annotation and not
in page contents. Note that range
represents coordinates of the text block in
annotation contents (not in the page text).
Number of the page that this text block resides on.
PDF rects represented by this text block. This list has at least one item.
Actual text range (i.e. start and end character index) of the represented text. This range is
on the page with pageIndex
. When source of the text block is annotation, this range
is relative to annotation contents.
Creates TextBlock
from textual annotation.
document | Document this text block resides on. |
---|---|
annotation | Annotation this text block resides on. |
range | Range of the text block inside annotation (i.e. start and end character index). |
Creates a TextBlock
from the given page.
document | Document this text block resides on. |
---|---|
pageIndex | Page this text block resides on. |
range | Range of the text block on page (i.e. start and end character index). |
Creates a TextBlock
from the given page.
pageIndex | Page this text block resides on. |
---|---|
range | Range of the text block on page (i.e. start and end character index). |
pageRects | PDF rects represented by this text block. |
text | The represented string on the document. |
Returns page text for a list of text blocks. The text is created by sequentially concatenating text blocks with a single space used as a separator.
document | Document this text block resides on. |
---|---|
textBlocks | List of text blocks to return text for. |