redaction
object is an instance accessible from the main mupdfwv.MuPDFWebViewer instance as follows:
This assumes you have returned your instance name as
mupdf
from the initMuPDFWebViewer() promise!redaction
Theredaction
object has the following methods:
get
get(config?: { textData: mupdf.refs.redaction.textDataOption })
Returns array of (unapplied) redactions for the document.
- Arguments:
- config – (optional) The configuration object. If undefined returns all redactions for all pages.
- Arguments:
- textData – (required) The text data option for the redaction.
- Returns:
Promise<Redaction[]>
.
Note: if redactions have been previously applied then these redactions are permananent and, as we should expect, will not be returned!The
Redaction[]
array is an array of redaction objects.set
set(config: { redactions: Redaction[] })
Updates redactions.
- Arguments:
- config – (required) The configuration object.
- Arguments:
- redactions – (required) An array of redaction objects.
The
Redaction[]
array is an array of redaction objects.add
add(config: { redactions: Redaction[] })
Adds redactions.
- Arguments:
- config – (required) The configuration object.
- Arguments:
- redactions – (required) An array of redaction objects.
remove
remove(config: { redactions: Redaction[] })
Removes redactions.
- Arguments:
- config – (required) The configuration object.
- Arguments:
- redactions – (required) An array of redaction objects.
oid
or name
and pageIndex
for the unique key. Then the redaction will be removed.
apply
apply(config: { redactions: Redaction[] })
Applies redactions.
- Arguments:
- config – (required) The configuration object.
- Arguments:
- redactions – (required) An array of redaction objects.
oid
or name
and pageIndex
for the unique key. Then the redaction will be applied.
Redaction Object
TheRedaction
object is a JSON object as follows:
oid
(required): Object idpageIndex
(required): Page indexname
(required): Unique name in the pagerect
(optional): Rectangle{ top: number, left: number, bottom: number, right: number }
opacity
(optional): Opacity (0.0 ~ 1.0)author
(optional): AuthorcanBePrinted
(optional): Whether to be printedlocked
(optional): Whether to be locked
oid
or name
and pageIndex
as the unique key. Then the property will be updated.