Skip to main content

SearchAndRedact

Searchs words and adds redact to it.

Syntax

expression.SearchAndRedact(props);

expression - A variable that represents a ApiDocument class.

Parameters

NameRequired/OptionalData typeDefaultDescription
propsRequiredSearchPropsThe search options.

Returns

ApiRedactAnnotation[]

Example

Find and hide sensitive text in a PDF.

// How do I black out certain words throughout a PDF?

// Search for a word and apply redaction to all matches in a PDF.

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.`);