|
Foxit PDF SDK
|
Public 成员函数 | |
| TextSearchReplace (PDFDoc doc) throws com.foxit.sdk.PDFException | |
| 构造函数。 更多... | |
| TextSearchReplace (TextSearchReplace other) | |
| 拷贝构造函数。 更多... | |
| synchronized void | delete () |
| 直接清除C++相关资源。 更多... | |
| boolean | isEmpty () |
| 检查当前对象是否为空。 更多... | |
| boolean | replaceNext (String replace_text) throws com.foxit.sdk.PDFException |
| 用替换文本替换下一个文本。 更多... | |
| boolean | replacePrev (String replace_text) throws com.foxit.sdk.PDFException |
| 用替换文本替换上一个文本。 更多... | |
| void | setPattern (String keywords, int page_index, FindOption find_option) throws com.foxit.sdk.PDFException |
| 设置关键字和页面索引以进行搜索和替换。 更多... | |
| void | setReplaceCallback (ReplaceCallback replace_callback) throws com.foxit.sdk.PDFException |
| 设置替换回调函数。 更多... | |
此类可用于搜索和替换文本。 在使用此模块中的任何类或方法之前,请确保 Foxit PDF SDK 已成功初始化 通过函数 common.Library.initialize 使用包含 "AdvEdit" 模块的密钥。
| com.foxit.sdk.addon.pageeditor.TextSearchReplace.TextSearchReplace | ( | PDFDoc | doc | ) | throws com.foxit.sdk.PDFException |
构造函数。
| [in] | doc | 要搜索或替换的有效 PDF 文档对象。 目前,Foxit PDF SDK 不支持对动态 XFA 文档进行替换。 |
此构造函数用于构造文本搜索替换对象。
| com.foxit.sdk.addon.pageeditor.TextSearchReplace.TextSearchReplace | ( | TextSearchReplace | other | ) |
拷贝构造函数。
| [in] | other | 另一个文本搜索替换对象。 |
| synchronized void com.foxit.sdk.addon.pageeditor.TextSearchReplace.delete | ( | ) |
| boolean com.foxit.sdk.addon.pageeditor.TextSearchReplace.isEmpty | ( | ) |
检查当前对象是否为空。
当前对象为空时,意味着当前对象无用。
| boolean com.foxit.sdk.addon.pageeditor.TextSearchReplace.replaceNext | ( | String | replace_text | ) | throws com.foxit.sdk.PDFException |
用替换文本替换下一个文本。
| [in] | replace_text | 要替换的文本。不应为空字符串。 |
| boolean com.foxit.sdk.addon.pageeditor.TextSearchReplace.replacePrev | ( | String | replace_text | ) | throws com.foxit.sdk.PDFException |
用替换文本替换上一个文本。
| [in] | replace_text | 要替换的文本。不应为空字符串。 |
| void com.foxit.sdk.addon.pageeditor.TextSearchReplace.setPattern | ( | String | keywords, |
| int | page_index, | ||
| FindOption | find_option | ||
| ) | throws com.foxit.sdk.PDFException |
设置关键字和页面索引以进行搜索和替换。
| [in] | keywords | 要替换的文本内容。不应为空字符串。 |
| [in] | page_index | 将被搜索和替换的页面索引。有效范围:从 0 到 (count-1)。count 由 PDF 文档的函数 PDFDoc.getPageCount 返回。 这仅用于 TextSearchReplace.replacePrev 和 TextSearchReplace.replaceNext 。 |
| [in] | find_option | 查找选项。应该是有效的查找选项对象。 |
| void com.foxit.sdk.addon.pageeditor.TextSearchReplace.setReplaceCallback | ( | ReplaceCallback | replace_callback | ) | throws com.foxit.sdk.PDFException |
设置替换回调函数。
| [in] | replace_callback | 用于替换的回调对象。这应该由用户实现, 可以为 null。如果为 null,表示找到的文本总是需要被替换。 |