Some test text!

Applying redactions

Contents

Applying redactions with the WebViewer
Applying redactions programmatically

Redactions can be applied using the WebViewer UI or programmatically.

Please Note!
Even when programmatically applying redactions, fullAPI or pdftronServer must be set up. Furthermore when using WebViewer Server, applyRedactions will return a promise that resolves to a URL for the redacted document instead of updating the current document.

linkApplying redactions with the WebViewer

A user can simply click on a redaction annotation and click on the apply button to apply a single redaction.

There is also an 'Apply All' button that applies every redaction annotation in the document.

linkApplying redactions programmatically

Redactions can be applied using the applyRedactions function on AnnotationManager. applyRedactions returns a promise and can be used to apply a single redaction, an array of redactions, or all redactions in a document. When using WebViewer Server, the returned promise will resolve to a response object with a URL to download the redacted document.

var annotManager = docViewer.getAnnotationManager();
var redactionList = annotManager.getAnnotationsList().filter(function(annot) {return annot instanceof Annotations.RedactionAnnotation});

// apply a single redaction
annotManager.applyRedactions(redactionList[0])
  // When using WebViewer Server, 'results' will be a response object with a 'url' property for downloading the redacted document.
.then(function(results) {
  return annotManager.applyRedactions(redactionList.filter(function(redaction) { return redaction.Author === 'User'}));
  // When using WebViewer Server, the previous redaction will not appear in the results. It'll only redact the redactions provided to 'applyRedactions'.
  // However when using 'fullAPI', the document will have all previously applied redactions
}).then(function(results)} {
  return annotManager.applyRedactions();
});

Get the answers you need: Support

Contents

Applying redactions with the WebViewer
Applying redactions programmatically