Foxit PDF SDK
|
Public Types | |
enum | TextOrderFlag { TextOrderFlag.e_TextStreamOrder = 0, TextOrderFlag.e_TextDisplayOrder = 1 } |
Enumeration for text order flag which is used when getting text content of a PDF page. More... | |
enum | TextParseFlags { TextParseFlags.e_ParseTextNormal = 0x0000, TextParseFlags.e_ParseTextOutputHyphen = 0x0001, TextParseFlags.e_ParseTextUseStreamOrder = 0x0002 } |
Enumeration for parsing flags used for text page. More... | |
Public Member Functions | |
TextPage (PDFPage page, int flags) | |
Constructor, from a parsed PDF page. More... | |
TextPage (TextPage other) | |
Constructor, with another text page object. More... | |
Rotation | GetBaselineRotation (int rect_index) |
Get the text trend (as rotation) of a specified rectangle. More... | |
int | GetCharCount () |
Get the count of all the characters. More... | |
TextPageCharInfo | GetCharInfo (int char_index) |
Get character information of a specific character. More... | |
Range | GetCharRange (RectF rect) |
Get the character index range of all text rectangles within the specified rectangle region. More... | |
string | GetChars (int start, int count) |
Get all the characters within a range specified by a start index and count. More... | |
int | GetIndexAtPos (float x, float y, float tolerance) |
Get the character index at or around a specified position on the page, in [PDF coordinate system] (foxit.pdf.PDFPage). More... | |
string | GetText (TextPage.TextOrderFlag flag) |
Get the page text. More... | |
string | GetTextInRect (RectF rect) |
Get the text within a rectangle, in PDF coordinate system. More... | |
RectF | GetTextRect (int rect_index) |
Get the text rectangle by the index. More... | |
RectFArray | GetTextRectArrayByRect (RectF rect) |
Get the array of all text rectangles within the specified rectangle region. More... | |
int | GetTextRectCount (int start, int count) |
Count the text rectangles within a range specified by a start index and count. More... | |
string | GetTextUnderAnnot (Annot annot) |
Get the page text which intersect with a specified an annotation. More... | |
Range | GetWordAtPos (float x, float y, float tolerance) |
Get the character range of a word at or around a specified position on the page, in [PDF coordinate system] (foxit.pdf.PDFPage). More... | |
bool | IsEmpty () |
Check whether current object is empty or not. More... | |
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:
To search text in text contents of a PDF page, please construct a TextSearch object with text page object.
To access text that are used as a hypertext link, please construct a PageTextLinks object with text page object.
|
strong |
Enumeration for text order flag which is used when getting text content of a PDF page.
Values of this enumeration can be used alone.
|
strong |
Enumeration for parsing flags used for text page.
Values of this enumeration can be used alone or in combination.
|
inline |
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 foxit.pdf.TextPage.TextParseFlags.e_ParseTextNormal and this can be one or combination of these values. |
|
inline |
Constructor, with another text page object.
[in] | other | Another text page object. |
|
inline |
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 . |
|
inline |
Get the count of all the characters.
|
inline |
Get character information of a specific character.
[in] | char_index | A zero-based index of character. Range: from 0 to (charcount - 1).charcount is returned by function TextPage.GetCharCount . |
Get the character index range of all text rectangles within the specified rectangle region.
[in] | rect | A rectangle region, in PDF coordinate system. |
|
inline |
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 . |
[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 . |
|
inline |
Get the character index at or around a specified position on the page, in [PDF coordinate system] (foxit.pdf.PDFPage).
[in] | x | Value of x position, in PDF coordinate system. |
[in] | y | Value of y position, in PDF coordinate system. |
[in] | tolerance | Tolerance value for character hit detection, in point units. This should not be a negative. |
|
inline |
Get the page text.
[in] | flag | Text order flag to decide how to get text content of the related PDF page. Please refer to values starting from foxit.pdf.TextPage.TextOrderFlag.e_TextStreamOrder and this should be one of these values. |
|
inline |
Get the text within a rectangle, in PDF coordinate system.
[in] | rect | A rectangle region, in PDF coordinate system. |
|
inline |
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 . |
|
inline |
Get the array of all text rectangles within the specified rectangle region.
[in] | rect | A rectangle region, in PDF coordinate system. |
|
inline |
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. |
|
inline |
Get the page text which intersect with a specified an annotation.
If the whole character or most part of the character intersects with an annotation, this character will be retieved by current function.
[in] | annot | An annotation. Page text which intersects with this annotation is to be retrieved. Currently, only support text markup annotation (highlight/underline/strike-out/squggly annotations); for annotation in other types, this function will throw exception foxit.common.ErrorCode.e_ErrUnsupported . |
|
inline |
Get the character range of a word at or around a specified position on the page, in [PDF coordinate system] (foxit.pdf.PDFPage).
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 PDF coordinate system. |
[in] | y | Value of y position, in PDF coordinate system. |
[in] | tolerance | Tolerance value for word hit detection, in point units.This should not be a negative. |
|
inline |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.