Skip to main content
All docs
V25.1
  • PdfRedactAnnotationFacade.Apply(PdfClearContentOptions) Method

    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.1.Core.dll

    NuGet Package: DevExpress.Pdf.Core

    Declaration

    public void Apply(
        PdfClearContentOptions options = null
    )

    Optional Parameters

    Name Type Default Description
    options PdfClearContentOptions null

    Options that specify what content type to keep visible in the redaction area.

    Example

    The following code snippet applies redaction annotations made by a specific author:

    pdf document api redaction annotations apply

    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");
    }
    
    See Also