How can I search a document for a strings of text and create redaction annotations (but not apply the redactions) before viewing the document in WebViewer?
This code sample first specifies the text to search using a regex pattern, then uses the TextSearch API to find all instances of the text in the document. It then retrieves the highlight data of the text instances to get the coordinates of each instance, using the Redaction API to create annotations for each instance. Finally, it opens the document in WebViewer for viewing.
Note that this code creates the redaction annotations on top of the document, but does not actually apply the redactions to the document, allowing you to edit the redactions before they’re burned in.
If you’re hoping to apply the annotations before opening the document in WebViewer, check out the community post linked here.