Public Member Functions | |
TextPage (PDFPage page, int flags) throws com.foxit.sdk.PDFException | |
Constructor, from a parsed PDF page. More... | |
TextPage (TextPage other) | |
Constructor, with another text page object. More... | |
int | getBaselineRotation (int rect_index) throws com.foxit.sdk.PDFException |
Get the text trend (as rotation) of a specified rectangle. More... | |
int | getCharCount () throws com.foxit.sdk.PDFException |
Get the count of all the characters. More... | |
String | getChars (int start, int count) throws com.foxit.sdk.PDFException |
Get all the characters within a range specified by a start index and count. More... | |
int | getIndexAtPos (float x, float y, float tolerance) throws com.foxit.sdk.PDFException |
Get the character index at or around a specified position on the page, in . More... | |
String | getTextInRect (RectF rect) throws com.foxit.sdk.PDFException |
Get the text within a rectangle, in . More... | |
RectF | getTextRect (int rect_index) throws com.foxit.sdk.PDFException |
Get the text rectangle by the index. More... | |
RectFArray | getTextRectArrayByRect (RectF rect) throws com.foxit.sdk.PDFException |
Get the array of all text rectangles within the specified rectangle region. More... | |
int | getTextRectCount (int start, int count) throws com.foxit.sdk.PDFException |
Count the text rectangles within a range specified by a start index and count. More... | |
Range | getWordAtPos (float x, float y, float tolerance) throws com.foxit.sdk.PDFException |
Get the character range of a word at or around a specified position on the page, in . More... | |
boolean | isEmpty () |
Check whether current object is empty or not. More... | |
Static Public Attributes | |
static final int | e_ParseTextNormal = 0x0000 |
No special parsing options for text page. | |
static final int | e_ParseTextOutputHyphen = 0x0001 |
Parse the text content of a PDF page with outputting the hyphen on a line feed. | |
static final int | e_ParseTextUseStreamOrder = 0x0002 |
Parse the text content of a PDF page by the stream order. | |
PDF text page represents all the text contents in a PDF page, according to a specified parsing flag for these text. Class TextPage can be used to retrieve information about text in a PDF page, such as single character, single word, text content within specified character range or rectangle and so on.
This class object can also be used to construct objects of other text related classes in order to do more operation for text contents or access specified information from text contents:
com.foxit.sdk.pdf.TextPage.TextPage | ( | PDFPage | page, |
int | flags | ||
) | throws com.foxit.sdk.PDFException |
Constructor, from a parsed PDF page.
[in] | page | A valid PDF page object. This page should has been parsed. |
[in] | flags | Parsing flags for the text page. Please refer to values starting from com.foxit.sdk.pdf.TextPage.e_ParseTextNormal and this can be one or combination of these values. |
com.foxit.sdk.pdf.TextPage.TextPage | ( | TextPage | other | ) |
Constructor, with another text page object.
[in] | other | Another text page object. |
int com.foxit.sdk.pdf.TextPage.getBaselineRotation | ( | int | rect_index | ) | throws com.foxit.sdk.PDFException |
Get the text trend (as rotation) of a specified rectangle.
[in] | rect_index | The index of the rectangle to be retrieved. Valid range: from 0 to (count -1). count is returned by function TextPage.getTextRectCount . |
int com.foxit.sdk.pdf.TextPage.getCharCount | ( | ) | throws com.foxit.sdk.PDFException |
Get the count of all the characters.
String com.foxit.sdk.pdf.TextPage.getChars | ( | int | start, |
int | count | ||
) | throws com.foxit.sdk.PDFException |
Get all the characters within a range specified by a start index and count.
[in] | start | Index of start character, which is the first character of the expected text content. Valid range: from 0 to (charcount -1). charcount is returned by function TextPage.getCharCount . Default value: 0. |
[in] | count | Count of characters to be retrieved. -1 means to get the whole characters from start_index to the end of PDF page. Especially, when parameter count is larger than (charcount - start), all the rest character (from start_index) will be retrieved. charcount is returned by function TextPage.getCharCount . Default value: -1. |
int com.foxit.sdk.pdf.TextPage.getIndexAtPos | ( | float | x, |
float | y, | ||
float | tolerance | ||
) | throws com.foxit.sdk.PDFException |
Get the character index at or around a specified position on the page, in .
[in] | x | Value of x position, in . |
[in] | y | Value of y position, in . |
[in] | tolerance | Tolerance value for character hit detection, in point units. This should not be a negative. |
String com.foxit.sdk.pdf.TextPage.getTextInRect | ( | RectF | rect | ) | throws com.foxit.sdk.PDFException |
Get the text within a rectangle, in .
[in] | rect | A rectangle region, in . |
RectF com.foxit.sdk.pdf.TextPage.getTextRect | ( | int | rect_index | ) | throws com.foxit.sdk.PDFException |
Get the text rectangle by the index.
[in] | rect_index | The index of the rectangle to be retrieved. Valid range: from 0 to (count -1). count is returned by function TextPage.getTextRectCount . |
RectFArray com.foxit.sdk.pdf.TextPage.getTextRectArrayByRect | ( | RectF | rect | ) | throws com.foxit.sdk.PDFException |
Get the array of all text rectangles within the specified rectangle region.
[in] | rect | A rectangle region, in . |
int com.foxit.sdk.pdf.TextPage.getTextRectCount | ( | int | start, |
int | count | ||
) | throws com.foxit.sdk.PDFException |
Count the text rectangles within a range specified by a start index and count.
[in] | start | Index of start character in the character index range. Valid range: from 0 to (charcount -1). charcount is returned by function TextPage.getCharCount . |
[in] | count | Count of characters in the character index range. -1 means to get the whole characters from start_index to the end of PDF page. |
Range com.foxit.sdk.pdf.TextPage.getWordAtPos | ( | float | x, |
float | y, | ||
float | tolerance | ||
) | throws com.foxit.sdk.PDFException |
Get the character range of a word at or around a specified position on the page, in .
Currently, for Chinese/Japanese/Korean, only support to get a single character at or around the specified position.
[in] | x | Value of x position, in . |
[in] | y | Value of y position, in . |
[in] | tolerance | Tolerance value for word hit detection, in point units.This should not be a negative. |
boolean com.foxit.sdk.pdf.TextPage.isEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.