officefileapi-devexpress-dot-pdf-dot-pdfredactannotationfacade-dot-apply-x28-devexpress-dot-pdf-dot-pdfclearcontentoptions-x29.md
Applies the redaction annotation. Allows you to specify what content type to keep visible in the redaction area.
Namespace : DevExpress.Pdf
Assembly : DevExpress.Pdf.v25.2.Core.dll
NuGet Package : DevExpress.Pdf.Core
public void Apply(
PdfClearContentOptions options = null
)
Public Sub Apply(
options As PdfClearContentOptions = Nothing
)
| Name | Type | Default | Description |
|---|---|---|---|
| options | PdfClearContentOptions | null |
Options that specify what content type to keep visible in the redaction area.
|
The following code snippet applies redaction annotations made by a specific author:
using DevExpress.Pdf;
using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
processor.LoadDocument("output_to_review.pdf");
PdfDocumentFacade documentFacade = processor.DocumentFacade;
foreach (var page in documentFacade.Pages)
{
var redactionAnnotations = page.Annotations.Where(annotation => annotation.Type == PdfAnnotationType.Redaction).ToList();
foreach (PdfRedactAnnotationFacade annotation in redactionAnnotations)
{
if (annotation.Author == "Jane Doe")
annotation.Apply();
}
}
processor.SaveDocument("output_applied.pdf");
}
Using processor As New PdfDocumentProcessor()
Dim documentFacade As PdfDocumentFacade = processor.DocumentFacade
For Each page In documentFacade.Pages
Dim redactionAnnotations = page.Annotations.Where(Function(annotation) TypeOf annotation Is PdfRedactAnnotationFacade)
For Each annotation As PdfRedactAnnotationFacade In redactionAnnotations
' Apply redaction from a specific author
If annotation.Author = "Jane Doe" Then
annotation.Apply()
End If
Next annotation
Next page
End Using
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Apply(PdfClearContentOptions) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-pdf-viewer-redaction-annotations/CS/DXApplication1/Form1.cs#L59
redactAnnotation.Apply();
}
winforms-pdf-viewer-redaction-annotations/VB/DXApplication1/Form1.vb#L44
redactAnnotation.Apply()
Next rect
See Also
PdfRedactAnnotationFacade Class