java.lang.Object | |
↳ | com.pspdfkit.api.redaction.RedactionProcessor |
A document processor to add and apply redactions. To identify content to redact it can search for content based upon
regular expressions (RedactionRegEx
), and use common information presets, e.g. phone numbers, email
addresses. See RedactionPreset.Type
for a list of presets.
Each instruction used to identify content to redact we will call a redaction template, of which a RedactionProcessor
can use 1 or more to search for content to redact. To add a redaction template to the RedactionProcessor
, (addRedactionTemplates(RedactionTemplate)
) is called, which can be
called multiple times with a variable argument list of redaction templates.
Once the required templates have been added it's possible to redact content directly with redact(PdfDocument)
or redact(PdfDocument, WritableDataProvider)
. If
desired redaction annotations can be added to the document but not applied, allowing for further processing or
additional audits of content to be redacted before using save(DocumentSaveOptions)
to apply the
redactions.
The processor can take multiple calls to identifyAndAddRedactionAnnotations(PdfDocument)
and redact(PdfDocument)
to allow for batch processing on different documents.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RedactionProcessor() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RedactionProcessor |
addRedactionTemplates(RedactionTemplate... redactionTemplates)
Appends the given redaction templates to the processor.
| ||||||||||
static RedactionProcessor |
create()
Creates a
RedactionProcessor . | ||||||||||
void |
identifyAndAddRedactionAnnotations(PdfDocument document)
For the given
PdfDocument , use the redaction templates held by this RedactionProcessor to
identify items to be redacted. | ||||||||||
void |
redact(PdfDocument document, WritableDataProvider dataProvider)
For the given
PdfDocument , use the redaction templates that the processor holds to identify and
irreversibly remove the information from the document. | ||||||||||
void |
redact(PdfDocument document)
For the given
PdfDocument , use the redaction templates that the processor holds to identify and
irreversibly remove the information from the document. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Appends the given redaction templates to the processor. When processing the document, redaction templates will be used in the order they were added.
redactionTemplates | Templates to append to the processor. Can be zero or more non-null values. |
---|
Creates a RedactionProcessor
.
RedactionProcessor
.
For the given PdfDocument
, use the redaction templates held by this RedactionProcessor
to
identify items to be redacted. From tyhe 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.
document | The document to add the redaction annotations. |
---|
For the given PdfDocument
, use the redaction templates that the processor holds to identify and
irreversibly remove the information from the document.
document | The document to redact. |
---|---|
dataProvider | A data provider to write the redacted document. |
IOException |
---|
For the given PdfDocument
, use the redaction templates that the processor holds to identify and
irreversibly remove the information from the document.
document | The document to redact. |
---|
IOException |
---|