跳到主要内容

SearchAndRedact

搜索词语并对其添加涂黑。

语法

expression.SearchAndRedact(props);

expression - 表示 ApiDocument 类的变量。

参数

名称必需/可选数据类型默认值描述
props必需SearchProps未提供描述。

返回值

ApiRedactAnnotation[]

示例

在文档中搜索某个单词并为其添加密文注释。

// How can I search and redact using a document in a PDF document?

// Search and redact for a document in a PDF document.

let doc = Api.GetDocument();
doc.SearchAndRedact({text: "Lorem", matchCase: false, wholeWords: false});
doc.ApplyRedact();
console.log(`We searched for the word lorem in the document and applied redact annotation to all matches.`);