Skip to main content
All docs
V25.1
  • PdfPageFacade.ApplyRedactAnnotations(Func<PdfAnnotationFacade, Boolean>, PdfClearContentOptions) Method

    Applies redaction annotations based on the specified criteria and 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 ApplyRedactAnnotations(
        Func<PdfAnnotationFacade, bool> predicate,
        PdfClearContentOptions options = null
    )

    Parameters

    Name Type Description
    predicate Func<PdfAnnotationFacade, Boolean>

    Defines a set of criteria for the PdfAnnotationFacade object.

    Optional Parameters

    Name Type Default Description
    options PdfClearContentOptions null

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

    Remarks

    Example: Apply Redaction Annotations on Lower Half of the Page

    using DevExpress.Pdf;
    
    PdfDocumentProcessor pdfProcessor = new PdfDocumentProcessor();
    pdfProcessor.LoadDocument("Invoice.pdf");
    
    PdfDocumentFacade documentFacade = pdfProcessor.DocumentFacade;
    var pageFacade = documentFacade.Pages[0];
    
    double halfPage = pdfProcessor.Document.Pages[0].CropBox.Top / 2;
    pageFacade.ApplyRedactAnnotations(x => x.Rectangle.Top < halfPage);
    
    pdfProcessor.SaveDocument("output.pdf");
    
    See Also