|
Foxit PDF SDK
|
Public 类型 | |
| enum | TextOrderFlag { TextOrderFlag.e_TextStreamOrder = 0, TextOrderFlag.e_TextDisplayOrder = 1 } |
| 获取PDF页面文本内容时使用的文本顺序标志枚举。 更多... | |
| enum | TextParseFlags { TextParseFlags.e_ParseTextNormal = 0x0000, TextParseFlags.e_ParseTextOutputHyphen = 0x0001, TextParseFlags.e_ParseTextUseStreamOrder = 0x0002 } |
| 用于文本页面的解析标志枚举。 更多... | |
Public 成员函数 | |
| TextPage (PDFPage page, int flags) | |
| 从已解析的PDF页面构造函数。 更多... | |
| TextPage (TextPage other) | |
| 用另一个文本页面对象的构造函数。 更多... | |
| Rotation | GetBaselineRotation (int rect_index) |
| 获取指定矩形的文本趋势(作为旋转)。 更多... | |
| int | GetCharCount () |
| 获取所有字符的数量。 更多... | |
| TextPageCharInfo | GetCharInfo (int char_index) |
| 获取特定字符的字符信息。 更多... | |
| Range | GetCharRange (RectF rect) |
| 获取指定矩形区域内所有文本矩形的字符索引范围。 更多... | |
| string | GetChars (int start, int count) |
| 获取由起始索引和数量指定范围内的所有字符。 更多... | |
| int | GetIndexAtPos (float x, float y, float tolerance) |
| 获取页面上指定位置处或附近的字符索引, 在中。 更多... | |
| string | GetText (TextPage.TextOrderFlag flag) |
| 获取页面文本。 更多... | |
| string | GetTextInRect (RectF rect) |
| 获取矩形内的文本,在中。 更多... | |
| RectF | GetTextRect (int rect_index) |
| 通过索引获取文本矩形。 更多... | |
| RectFArray | GetTextRectArrayByRect (RectF rect) |
| 获取指定矩形区域内所有文本矩形的数组。 更多... | |
| int | GetTextRectCount (int start, int count) |
| 计算由起始索引和数量指定范围内的文本矩形。 更多... | |
| string | GetTextUnderAnnot (Annot annot) |
| 获取与指定注释相交的页面文本。 更多... | |
| Range | GetWordAtPos (float x, float y, float tolerance) |
| 获取页面上指定位置处或附近单词的字符范围, 在中。 更多... | |
| bool | IsEmpty () |
| 检查当前对象是否为空。 更多... | |
PDF文本页面表示PDF页面中的所有文本内容,根据为这些文本指定的解析标志。 类 TextPage 可用于检索PDF页面中文本的信息,例如单个字符、单个单词、 指定字符范围或矩形内的文本内容等。
此类对象还可用于构造其他文本相关类的对象,以便对文本内容进行更多操作 或从文本内容访问指定信息:
要在PDF页面的文本内容中搜索文本,请使用文本页面对象构造 TextSearch 对象。
要访问用作超文本链接的文本,请使用文本页面对象构造 PageTextLinks 对象。
|
strong |
|
strong |
|
inline |
从已解析的PDF页面构造函数。
| [in] | page | 有效的PDF页面对象。此页面应已被解析。 |
| [in] | flags | 文本页面的解析标志。请参考从 foxit.pdf.TextPage.TextParseFlags.e_ParseTextNormal 开始的值,这可以是这些值中的一个或组合。 |
|
inline |
用另一个文本页面对象的构造函数。
| [in] | other | 另一个文本页面对象。 |
|
inline |
获取指定矩形的文本趋势(作为旋转)。
| [in] | rect_index | 要检索的矩形的索引。 有效范围:从0到(count -1)。count 由函数 TextPage.GetTextRectCount 返回。 |
|
inline |
获取所有字符的数量。
|
inline |
获取特定字符的字符信息。
| [in] | char_index | 字符的从零开始的索引。 范围:从0到(charcount - 1)。charcount 由函数 TextPage.GetCharCount 返回。 |
获取指定矩形区域内所有文本矩形的字符索引范围。
| [in] | rect | 矩形区域,在中。 |
|
inline |
获取由起始索引和数量指定范围内的所有字符。
| [in] | start | 起始字符的索引,它是期望文本内容的第一个字符。 有效范围:从0到(charcount -1)。charcount 由函数 TextPage.GetCharCount 返回。默认值:0。 |
| [in] | count | 要检索的字符数量。-1表示获取从start_index到PDF页面末尾的 所有字符。特别地,当参数count 大于(charcount - start),将检索所有剩余字符 (从start_index开始)。charcount 由函数 TextPage.GetCharCount 返回。默认值:-1。 |
|
inline |
获取页面上指定位置处或附近的字符索引, 在中。
| [in] | x | x位置的值,在中。 |
| [in] | y | y位置的值,在中。 |
| [in] | tolerance | 字符命中检测的容差值,以点为单位。这不应为负数。 |
|
inline |
获取页面文本。
| [in] | flag | 文本顺序标志,决定如何获取相关PDF页面的文本内容。请参考从 foxit.pdf.TextPage.TextOrderFlag.e_TextStreamOrder 开始的值,这应该是这些值中的一个。 |
|
inline |
获取矩形内的文本,在中。
| [in] | rect | 矩形区域,在中。 |
|
inline |
通过索引获取文本矩形。
| [in] | rect_index | 要检索的矩形的索引。 有效范围:从0到(count -1)。count 由函数 TextPage.GetTextRectCount 返回。 |
|
inline |
获取指定矩形区域内所有文本矩形的数组。
| [in] | rect | 矩形区域,在中。 |
|
inline |
计算由起始索引和数量指定范围内的文本矩形。
| [in] | start | 字符索引范围中起始字符的索引。 有效范围:从0到(charcount -1)。charcount 由函数 TextPage.GetCharCount 返回。 |
| [in] | count | 字符索引范围中的字符数量。-1表示获取从start_index到PDF页面末尾的 所有字符。 |
|
inline |
获取与指定注释相交的页面文本。
如果整个字符或字符的大部分与注释相交, 当前函数将检索此字符。
| [in] | annot | 注释。要检索与此注释相交的页面文本。 目前,仅支持文本标记注释 (高亮/下划线/删除线/波浪线注释);对于其他类型的注释, 此函数将抛出异常 foxit.common.ErrorCode.e_ErrUnsupported 。 |
|
inline |
获取页面上指定位置处或附近单词的字符范围, 在中。
目前,对于中文/日文/韩文,仅支持获取指定位置处或附近的单个字符。
| [in] | x | x位置的值,在中。 |
| [in] | y | y位置的值,在中。 |
| [in] | tolerance | 单词命中检测的容差值,以点为单位。这不应为负数。 |
|
inline |
检查当前对象是否为空。
当前对象为空时,意味着当前对象无用。