Class RedactionProcessor

A document processor to add and apply redactions. The processor supports redaction based upon regular expressions (RedactionRegEx) and redacting of common information using predefined presets (phone numbers, email, address). See RedactionPreset.Type for a list of presets.

A redaction template is defined (AddRedactionTemplates(IEnumerable<RedactionTemplate>)) before either adding redaction annotations to the document (IdentifyAndAddRedactionAnnotations(Document)) or immediately redacting the information directly from the document (Redact(Document)).

The processor can take multiple calls to IdentifyAndAddRedactionAnnotations(Document) and Redact(Document) to allow for batch processing on different documents.

Inheritance
System.Object
RedactionProcessor
Namespace: PSPDFKit.Redaction
Assembly: PSPDFKit.dll
Syntax
public class RedactionProcessor : object

Methods

AddRedactionTemplates(IEnumerable<RedactionTemplate>)

Append multiple redaction templates to the processor to be used when processing documents.

Declaration
public RedactionProcessor AddRedactionTemplates(IEnumerable<RedactionTemplate> redactionTemplates)
Parameters
Type Name Description
IEnumerable<RedactionTemplate> redactionTemplates

A list of redaction templates.

Returns
Type Description
RedactionProcessor

Create()

Creates an instance of a redaction processor

Declaration
public static RedactionProcessor Create()
Returns
Type Description
RedactionProcessor

An instance of a redaction processor

IdentifyAndAddRedactionAnnotations(Document)

For the given Document, use the redaction templates held by this RedactionProcessor to identify items to be redacted. From the identified information redaction annotations will be added to the document. The document will NOT yet have the redactions applied and sensitive information will still be present.

Declaration
public void IdentifyAndAddRedactionAnnotations(Document document)
Parameters
Type Name Description
Document document

The document to add the redaction annotations.

Redact(Document)

For the given Document, use the redaction templates that the processor holds to identify and irreversibly remove the information from the document.

Declaration
public void Redact(Document document)
Parameters
Type Name Description
Document document

The document to redact.

Redact(Document, IWritableDataProvider)

For the given Document, use the redaction templates that the processor holds to identify and irreversibly remove the information from the document.

Declaration
public void Redact(Document document, IWritableDataProvider dataProvider)
Parameters
Type Name Description
Document document

The document to redact.

IWritableDataProvider dataProvider

A data provider to write the redacted document.