java.lang.Object | |
↳ | com.pdftron.pdf.TextRange |
The TextRange
is used to store the necessary information and perform certain
It may be the result of a text search, or simply a couple of highlighted or
underlined words.
Each text range contains a few pieces of information:
You are able to retrieve further information about the text range, such as its coordinates, the text itself, as well as characters before and after.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TextRange()
Instantiate default text range.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
close()
Frees the native memory of the object.
| ||||||||||
void |
destroy()
Frees the native memory of the object.
| ||||||||||
int |
getPageNumber()
Get the page number of the text range.
| ||||||||||
double[] |
getQuads()
Get the corresponding quadrangles of the text range.
| ||||||||||
String |
getText()
Get the Unicode string content of the text range.
| ||||||||||
String |
getTextAfter(int count)
Get the Unicode string content immediately after the text range.
| ||||||||||
String |
getTextBefore(int count)
Get the Unicode string content immediately before the text range.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
java.lang.AutoCloseable
|
Instantiate default text range.
Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
Frees the native memory of the object. This can be explicity called to control the deallocation of native memory and avoid situations where the garbage collector does not free the object in a timely manner.
Get the page number of the text range.
Get the corresponding quadrangles of the text range.
Note: since a highlight may correspond to multiple quadrangles, e.g., when it crosses a line, the number of resulting quadrangles may be larger than 1.
Get the Unicode string content of the text range.
Get the Unicode string content immediately after the text range.
count | the number of characters to retrieve after the text range. |
---|
Get the Unicode string content immediately before the text range.
count | the number of characters to retrieve before the text range. |
---|