public class CPDFTextPage
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
close()
When the object is no longer in use, call this method to release resources.
|
java.lang.String |
getBoundedText(android.graphics.RectF boundRect)
Gets the text enclosed within the specified rectangle.
|
android.graphics.RectF |
getCharBox(int index)
Gets bounding box of the character by index.
|
int |
getCharIndexAtPos(android.graphics.PointF point,
float toleranceHor,
float toleranceVer)
Gets index of the character at or nearby a certain position on the page.
|
CPDFTextRange |
getCharsRangeAtPos(android.graphics.PointF first,
android.graphics.PointF second,
float toleranceHor,
float toleranceVer)
Gets a range representing text between first and second.
|
int |
getCountChars()
Gets the count of all the characters on the page.
|
CPDFTextSelection |
getSelectionForLineAtPos(android.graphics.PointF position)
Given a point in page-space, gets a selection representing a whole line at that point.
|
CPDFTextSelection |
getSelectionForWordPos(android.graphics.PointF position)
Given a point in page-space, gets a selection representing a whole word at that point.
|
CPDFTextSelection[] |
getSelectionsByLineForRange(CPDFTextRange textRange)
Gets all the lines selection enclosed within the specified range.
|
CPDFTextSelection[] |
getSelectionsByLineForRect(android.graphics.RectF rect)
Gets all the lines selection enclosed within the specified rectangle, more:
CPDFTextSelection |
CPDFTextSelection[] |
getSelectionsByTextForRange(CPDFTextRange textRange)
Gets all the words selection enclosed within the specified range, more:
CPDFTextSelection |
java.lang.String |
getText(CPDFTextRange range)
Gets the text enclosed within the specified range.
|
boolean |
isValid()
Whether CPDFTextPage is valid.
|
public boolean isValid()
public int getCountChars()
public android.graphics.RectF getCharBox(int index)
index - Character index on the page.public java.lang.String getText(CPDFTextRange range)
range - Text range, more: CPDFTextRangepublic java.lang.String getBoundedText(android.graphics.RectF boundRect)
boundRect - Rectangle for the given range of characters.public int getCharIndexAtPos(android.graphics.PointF point,
float toleranceHor,
float toleranceVer)
point - The specified point in page-space.toleranceHor - x-axis tolerance value for character hit detection, in point units.toleranceVer - y-axis tolerance value for character hit detection, in point units.public CPDFTextRange getCharsRangeAtPos(android.graphics.PointF first, android.graphics.PointF second, float toleranceHor, float toleranceVer)
first - The first point between the two points.second - The second point between the two points.toleranceHor - x-axis tolerance value for character hit detection, in point units.toleranceVer - y-axis tolerance value for character hit detection, in point units.CPDFTextRange Returns the text range of the two points.public CPDFTextSelection getSelectionForWordPos(android.graphics.PointF position)
position - A point in page-space.public CPDFTextSelection getSelectionForLineAtPos(android.graphics.PointF position)
position - A point in page-space.CPDFTextSelectionpublic CPDFTextSelection[] getSelectionsByLineForRange(CPDFTextRange textRange)
textRange - Text rangeCPDFTextSelectionpublic CPDFTextSelection[] getSelectionsByLineForRect(android.graphics.RectF rect)
CPDFTextSelectionrect - Text rectangle.public CPDFTextSelection[] getSelectionsByTextForRange(CPDFTextRange textRange)
CPDFTextSelectiontextRange - Text range, more: CPDFTextRangepublic void close()