Skip to main content
All docs
V25.1
  • PdfPageFacade.AddRedactAnnotation(PdfRectangle) Method

    Creates a redaction annotation in the specified page area.

    Namespace: DevExpress.Pdf

    Assembly: DevExpress.Pdf.v25.1.Core.dll

    NuGet Package: DevExpress.Pdf.Core

    Declaration

    public PdfRedactAnnotationFacade AddRedactAnnotation(
        PdfRectangle rectangle
    )

    Parameters

    Name Type Description
    rectangle PdfRectangle

    A rectangle where the redaction annotation should be located.

    Returns

    Type Description
    PdfRedactAnnotationFacade

    An object that contains redaction annotation properties.

    Remarks

    Example: Create a Redaction Annotation at the Top-Left Corner

    using DevExpress.Pdf;
    
    PdfDocumentProcessor pdfProcessor = new PdfDocumentProcessor();
    pdfProcessor.LoadDocument("Demo.pdf");
    
    PdfDocumentFacade documentFacade = pdfProcessor.DocumentFacade;
    PdfRectangle pageCropBox = pdfProcessor.Document.Pages[0].CropBox;
    PdfRectangle redactBounds = new PdfRectangle(0, pageCropBox.Height - 50, 200, pageCropBox.Height);
    
    // Add a redaction annotation at the top left corner of the first document page
    PdfRedactAnnotationFacade redactAnnotation = documentFacade.Pages[0].AddRedactAnnotation(redactBounds);
    redactAnnotation.Author = "Jane Doe";
    // Setup the redaction annotation appearance
    redactAnnotation.FillColor = new PdfRGBColor(0, 0, 0);
    redactAnnotation.FontColor = new PdfRGBColor(1, 1, 1);
    redactAnnotation.FontName = "Calibri";
    redactAnnotation.FontSize = 0; // enables font auto-size
    redactAnnotation.OverlayText = "Classified";
    redactAnnotation.TextJustification = PdfTextJustification.Centered;
    redactAnnotation.RepeatText = false;
    
    // Save the document with the redaction annotation and send it for review
    pdfProcessor.SaveDocument("output_to_review.pdf");
    
    See Also