redaction object is an instance accessible from the main MuPDFWebViewer instance as follows:
This assumes you have returned your instance name as
webViewer from the initMuPDFWebViewer() promise!redaction
Theredaction object has the following methods:
get
Parameters
object
Optional configuration. If omitted, returns all redactions for all pages.
Returns
Promise<{ redactions: Annotation[] }>
required
A Promise that resolves to an object containing
redactions.Note: if redactions have been previously applied then these redactions are permanent and, as we should expect, will not be returned!Use
result.redactions to access the redaction array.set
Parameters
object
required
The configuration object.
Use this method to update existing redactions by unique identifier.
add
Parameters
object
required
The configuration object.
remove
Parameters
object
required
The configuration object.
oid, name, and pageIndex. Matching redactions are removed.
apply
Parameters
object
required
The configuration object.
oid, name, and pageIndex. Matching redactions are applied.