|
Foxit PDF SDK
|
Public 成员函数 | |
| TextPage (PDFPage page, int flags) throws com.foxit.sdk.PDFException | |
| 从已解析的PDF页面构造函数。 更多... | |
| TextPage (TextPage other) | |
| 用另一个文本页面对象的构造函数。 更多... | |
| synchronized void | delete () |
| 直接清除C++相关资源。 更多... | |
| int | getBaselineRotation (int rect_index) throws com.foxit.sdk.PDFException |
| 获取指定矩形的文本趋势(作为旋转)。 更多... | |
| int | getCharCount () throws com.foxit.sdk.PDFException |
| 获取所有字符的数量。 更多... | |
| TextPageCharInfo | getCharInfo (int char_index) throws com.foxit.sdk.PDFException |
| 获取特定字符的字符信息。 更多... | |
| Range | getCharRange (RectF rect) throws com.foxit.sdk.PDFException |
| 获取指定矩形区域内所有文本矩形的字符索引范围。 更多... | |
| String | getChars (int start, int count) throws com.foxit.sdk.PDFException |
| 获取由起始索引和数量指定范围内的所有字符。 更多... | |
| int | getIndexAtPos (float x, float y, float tolerance) throws com.foxit.sdk.PDFException |
| 获取页面上指定位置处或附近的字符索引, 在中。 更多... | |
| String | getText (int flag) throws com.foxit.sdk.PDFException |
| 获取页面文本。 更多... | |
| String | getTextInRect (RectF rect) throws com.foxit.sdk.PDFException |
| 获取矩形内的文本,在中。 更多... | |
| RectF | getTextRect (int rect_index) throws com.foxit.sdk.PDFException |
| 通过索引获取文本矩形。 更多... | |
| RectFArray | getTextRectArrayByRect (RectF rect) throws com.foxit.sdk.PDFException |
| 获取指定矩形区域内所有文本矩形的数组。 更多... | |
| int | getTextRectCount (int start, int count) throws com.foxit.sdk.PDFException |
| 计算由起始索引和数量指定范围内的文本矩形。 更多... | |
| String | getTextUnderAnnot (Annot annot) throws com.foxit.sdk.PDFException |
| 获取与指定注释相交的页面文本。 更多... | |
| Range | getWordAtPos (float x, float y, float tolerance) throws com.foxit.sdk.PDFException |
| 获取页面上指定位置处或附近单词的字符范围, 在中。 更多... | |
| boolean | isEmpty () |
| 检查当前对象是否为空。 更多... | |
静态 Public 属性 | |
| static final int | e_ParseTextNormal = 0x0000 |
| 通过根据字符在PDF页面中的位置规范化字符来解析PDF页面的文本内容。 | |
| static final int | e_ParseTextOutputHyphen = 0x0001 |
| 在换行时输出连字符来解析PDF页面的文本内容。 | |
| static final int | e_ParseTextUseStreamOrder = 0x0002 |
| 按流顺序解析PDF页面的文本内容。 | |
| static final int | e_TextDisplayOrder = 1 |
| 如果设置,表示按显示顺序获取PDF页面的文本内容。 | |
| static final int | e_TextStreamOrder = 0 |
| 如果设置,表示按流顺序获取PDF页面的文本内容。 | |
PDF文本页面表示PDF页面中的所有文本内容,根据为这些文本指定的解析标志。 类 TextPage 可用于检索PDF页面中文本的信息,例如单个字符、单个单词、 指定字符范围或矩形内的文本内容等。
此类对象还可用于构造其他文本相关类的对象,以便对文本内容进行更多操作 或从文本内容访问指定信息:
| com.foxit.sdk.pdf.TextPage.TextPage | ( | PDFPage | page, |
| int | flags | ||
| ) | throws com.foxit.sdk.PDFException |
从已解析的PDF页面构造函数。
| [in] | page | 有效的PDF页面对象。此页面应已被解析。 |
| [in] | flags | 文本页面的解析标志。请参考从 com.foxit.sdk.pdf.TextPage.e_ParseTextNormal 开始的值,这可以是这些值中的一个或组合。 |
| com.foxit.sdk.pdf.TextPage.TextPage | ( | TextPage | other | ) |
用另一个文本页面对象的构造函数。
| [in] | other | 另一个文本页面对象。 |
| synchronized void com.foxit.sdk.pdf.TextPage.delete | ( | ) |
| int com.foxit.sdk.pdf.TextPage.getBaselineRotation | ( | int | rect_index | ) | throws com.foxit.sdk.PDFException |
获取指定矩形的文本趋势(作为旋转)。
| [in] | rect_index | 要检索的矩形的索引。 有效范围:从0到(count -1)。count 由函数 TextPage.getTextRectCount 返回。 |
| int com.foxit.sdk.pdf.TextPage.getCharCount | ( | ) | throws com.foxit.sdk.PDFException |
获取所有字符的数量。
| TextPageCharInfo com.foxit.sdk.pdf.TextPage.getCharInfo | ( | int | char_index | ) | throws com.foxit.sdk.PDFException |
获取特定字符的字符信息。
| [in] | char_index | 字符的从零开始的索引。 范围:从0到(charcount - 1)。charcount 由函数 TextPage.getCharCount 返回。 |
| Range com.foxit.sdk.pdf.TextPage.getCharRange | ( | RectF | rect | ) | throws com.foxit.sdk.PDFException |
获取指定矩形区域内所有文本矩形的字符索引范围。
| [in] | rect | 矩形区域,在中。 |
| String com.foxit.sdk.pdf.TextPage.getChars | ( | int | start, |
| int | count | ||
| ) | throws com.foxit.sdk.PDFException |
获取由起始索引和数量指定范围内的所有字符。
| [in] | start | 起始字符的索引,它是期望文本内容的第一个字符。 有效范围:从0到(charcount -1)。charcount 由函数 TextPage.getCharCount 返回。默认值:0。 |
| [in] | count | 要检索的字符数量。-1表示获取从start_index到PDF页面末尾的 所有字符。特别地,当参数count 大于(charcount - start),将检索所有剩余字符 (从start_index开始)。charcount 由函数 TextPage.getCharCount 返回。默认值:-1。 |
| int com.foxit.sdk.pdf.TextPage.getIndexAtPos | ( | float | x, |
| float | y, | ||
| float | tolerance | ||
| ) | throws com.foxit.sdk.PDFException |
获取页面上指定位置处或附近的字符索引, 在中。
| [in] | x | x位置的值,在中。 |
| [in] | y | y位置的值,在中。 |
| [in] | tolerance | 字符命中检测的容差值,以点为单位。这不应为负数。 |
| String com.foxit.sdk.pdf.TextPage.getText | ( | int | flag | ) | throws com.foxit.sdk.PDFException |
获取页面文本。
| [in] | flag | 文本顺序标志,决定如何获取相关PDF页面的文本内容。请参考从 com.foxit.sdk.pdf.TextPage.e_TextStreamOrder 开始的值,这应该是这些值中的一个。 |
| String com.foxit.sdk.pdf.TextPage.getTextInRect | ( | RectF | rect | ) | throws com.foxit.sdk.PDFException |
获取矩形内的文本,在中。
| [in] | rect | 矩形区域,在中。 |
| RectF com.foxit.sdk.pdf.TextPage.getTextRect | ( | int | rect_index | ) | throws com.foxit.sdk.PDFException |
通过索引获取文本矩形。
| [in] | rect_index | 要检索的矩形的索引。 有效范围:从0到(count -1)。count 由函数 TextPage.getTextRectCount 返回。 |
| RectFArray com.foxit.sdk.pdf.TextPage.getTextRectArrayByRect | ( | RectF | rect | ) | throws com.foxit.sdk.PDFException |
获取指定矩形区域内所有文本矩形的数组。
| [in] | rect | 矩形区域,在中。 |
| int com.foxit.sdk.pdf.TextPage.getTextRectCount | ( | int | start, |
| int | count | ||
| ) | throws com.foxit.sdk.PDFException |
计算由起始索引和数量指定范围内的文本矩形。
| [in] | start | 字符索引范围中起始字符的索引。 有效范围:从0到(charcount -1)。charcount 由函数 TextPage.getCharCount 返回。 |
| [in] | count | 字符索引范围中的字符数量。-1表示获取从start_index到PDF页面末尾的 所有字符。 |
| String com.foxit.sdk.pdf.TextPage.getTextUnderAnnot | ( | Annot | annot | ) | throws com.foxit.sdk.PDFException |
获取与指定注释相交的页面文本。
如果整个字符或字符的大部分与注释相交, 当前函数将检索此字符。
| [in] | annot | 注释。要检索与此注释相交的页面文本。 目前,仅支持文本标记注释 (高亮/下划线/删除线/波浪线注释);对于其他类型的注释, 此函数将抛出异常 com.foxit.sdk.common.Constants.e_ErrUnsupported 。 |
| Range com.foxit.sdk.pdf.TextPage.getWordAtPos | ( | float | x, |
| float | y, | ||
| float | tolerance | ||
| ) | throws com.foxit.sdk.PDFException |
获取页面上指定位置处或附近单词的字符范围, 在中。
目前,对于中文/日文/韩文,仅支持获取指定位置处或附近的单个字符。
| [in] | x | x位置的值,在中。 |
| [in] | y | y位置的值,在中。 |
| [in] | tolerance | 单词命中检测的容差值,以点为单位。这不应为负数。 |
| boolean com.foxit.sdk.pdf.TextPage.isEmpty | ( | ) |
检查当前对象是否为空。
当前对象为空时,意味着当前对象无用。