PDFContentRedactor¶
Namespace: O2S.Components.PDF4NET.Redaction
Defines a redactor for PDF page content.
Inheritance Object → PDFContentRedactor
Constructors¶
PDFContentRedactor(PDFPage)¶
Initializes a new PDFContentRedactor object.
Parameters
page PDFPage
The page from which content is redacted.
Methods¶
ApplyRedaction()¶
Applies the redaction on the PDF page.
Exceptions
PDFInvalidStateException
Thrown when the page has been closed before the redaction has been applied.
Remarks
The PDFContentRedactor.BeginRedaction() / PDFContentRedactor.ApplyRedaction() pair of methods lets you redact multiple areas on a PDF page in a single step. The page content is redacted when this method is called if redaction has been initialized with the PDFContentRedactor.BeginRedaction() method and redaction areas have been setup by one or more calls to PDFContentRedactor.RedactArea(PDFDisplayRectangle) method.
BeginRedaction()¶
Initializes the redaction process.
Remarks
The PDFContentRedactor.BeginRedaction() / PDFContentRedactor.ApplyRedaction() pair of methods lets you redact multiple areas on a PDF page in a single step. When this method has been called, the PDFContentRedactor.RedactArea(PDFDisplayRectangle) method has no immediate effect, the actual redaction takes place when PDFContentRedactor.ApplyRedaction() method is called. If this method is called but the PDFContentRedactor.ApplyRedaction() method is not called, the redaction process does not take place.
RedactAnnotation(PDFRedactionAnnotation)¶
Redacts the area specified by the redaction annotation.
Parameters
redactionAnnotation PDFRedactionAnnotation
The redaction annotation that specifies the area to redact.
Exceptions
PDFInvalidStateException
Thrown when the page has been closed before the redaction has been applied.
RedactAnnotations()¶
Redacts the areas specified by the redaction annotations on the current page.
Exceptions
PDFInvalidStateException
Thrown when the page has been closed before the redaction has been applied.
RedactArea(PDFDisplayRectangle)¶
Redacts the page content from the specified area.
Parameters
redactionArea PDFDisplayRectangle
Area from which the content should be redacted.
Exceptions
PDFInvalidStateException
Thrown when the page has been closed before the redaction has been applied.
Remarks
If PDFContentRedactor.BeginRedaction() method has not been called before then the content is redacted immediately. Otherwise the redaction area is stored and the redaction takes place when PDFContentRedactor.ApplyRedaction() method has been called.
RedactArea(PDFDisplayRectangle, PDFColor)¶
Redacts the page content from the specified area.
Parameters
redactionArea PDFDisplayRectangle
Area from which the content should be redacted.
redactionColor PDFColor
Color used for masking the redacted area.
Exceptions
PDFInvalidStateException
Thrown when the page has been closed before the redaction has been applied.
Remarks
If PDFContentRedactor.BeginRedaction() method has not been called before then the content is redacted immediately. Otherwise the redaction area is stored and the redaction takes place when PDFContentRedactor.ApplyRedaction() method has been called.
RedactArea(PDFDisplayRectangle, PDFColor, PDFContentRedactType)¶
Redacts the page content from the specified area.
public void RedactArea(PDFDisplayRectangle redactionArea, PDFColor redactionColor, PDFContentRedactType contentRedactType)
Parameters
redactionArea PDFDisplayRectangle
Area from which the content should be redacted.
redactionColor PDFColor
Color used for masking the redacted area.
contentRedactType PDFContentRedactType
Specifies the type of content to be redacted.
Exceptions
PDFInvalidStateException
Thrown when the page has been closed before the redaction has been applied.
Remarks
If PDFContentRedactor.BeginRedaction() method has not been called before then the content is redacted immediately. Otherwise the redaction area is stored and the redaction takes place when PDFContentRedactor.ApplyRedaction() method has been called.
RedactArea(PDFDisplayRectangle, PDFContentRedactionOptions)¶
Redacts the page content from the specified area.
public void RedactArea(PDFDisplayRectangle redactionArea, PDFContentRedactionOptions redactionOptions)
Parameters
redactionArea PDFDisplayRectangle
Area from which the content should be redacted.
redactionOptions PDFContentRedactionOptions
Options for content redaction.
Exceptions
PDFInvalidStateException
Thrown when the page has been closed before the redaction has been applied.
Remarks
If PDFContentRedactor.BeginRedaction() method has not been called before then the content is redacted immediately. Otherwise the redaction area is stored and the redaction takes place when PDFContentRedactor.ApplyRedaction() method has been called.