For the complete documentation index, see llms.txt. This page is also available as Markdown.

Creating redactions

Requirements

These packages are required to use these features in production. Trial keys have unlimited access to all features

Package: RedactionLive demo

Redactions can be created using the WebViewer UI or programmatically.

Creating redactions with the UI

To create a new redaction in WebViewer, click on the redaction tool icon to enter redaction mode. Next click and drag on the document to create a new redaction. Note that when creating a redaction on top of text, multiple rectangles are created, similar to when highlighting text.

Creating redactions programmatically

Redactions can be added to a document similarly to other annotations, by adding them to the AnnotationManager and redrawing. Redaction annotations have two differences compared to other annotation types.

  1. setRect() should be used instead of setting X,Y,Height, or Width directly

  2. The redaction annotation constructor can take an options object that can be used to configure the annotation. There are a number of properties that can be set using the constructor:

  • StrokeColor: This is the border color of the redaction before it been applied. Defaults to red.

  • FillColor: This is the fill color of the redaction after it been applied. Defaults to black.

  • PageNumber: The page that the redaction should appear on.

  • Rect: A Math.Rect object of the redaction area.

  • Quads: An array of Math.Quad objects of to specify multiple redaction areas. If Quads are provided then Rect is not needed.

Last updated

Was this helpful?