Skip to main content
The 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

The redaction object has the following methods:

get

Returns an object containing (unapplied) redactions for the document.

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.
Example
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

Updates redactions.

Parameters

object
required
The configuration object.
Use this method to update existing redactions by unique identifier.

add

Adds redactions.

Parameters

object
required
The configuration object.

remove

Removes redactions.

Parameters

object
required
The configuration object.
Each redaction item must include oid, name, and pageIndex. Matching redactions are removed.

apply

Applies redactions.

Parameters

object
required
The configuration object.
Each redaction item must include oid, name, and pageIndex. Matching redactions are applied.

Redaction Types

The API uses different item shapes per method:

Supporting Types