menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfRedactionResult - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfRedactionResult

    Represents a redaction result for a loaded page.

    Inheritance
    System.Object
    PdfRedactionResult
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Pdf.Redaction
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfRedactionResult
    Examples
    //Load the document.
    PdfLoadedDocument lDoc = new PdfLoadedDocument("input.pdf");
    //Get the first page from the document.
    PdfLoadedPage page = lDoc.Pages[0] as PdfLoadedPage;
    //Create a redaction object
    PdfRedaction redaction = new PdfRedaction(new RectangleF(40, 40, 50, 20));
    //Add redaction object into redaction collection of loaded page
    page.Redactions.Add(redaction);
    //Redact the contents from PDF document.
    List<PdfRedactionResult> results = lDoc.Redact();
    //Save and Close the document.
    lDoc.Save("sample.pdf");
    lDoc.Close(true);
    'Load the document.
    Dim lDoc As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
    'Get the first page from document
    Dim page As PdfLoadedPage = TryCast(doc.Pages(0), PdfLoadedPage)
    //Create a redaction object
    Dim redaction As PdfRedaction = New PdfRedaction(New RectangleF(40, 40, 50, 20))
    //Add redaction object into collection
    page.Redactions.Add(redaction)
    'Redact the contents from PDF document
    Dim results As List(Of PdfRedactionResult) = lDoc.Redact()
    'Save the document.
    lDoc.Save("sample.pdf")
    lDoc.Close(True)

    Properties

    IsRedactionSuccess

    Gets the particular bounds is redacted or not. Default value is false.

    Declaration
    public bool IsRedactionSuccess { get; }
    Property Value
    Type
    System.Boolean
    Examples
     //Load the document.
     PdfLoadedDocument lDoc = new PdfLoadedDocument("input.pdf");
     //Get the first page from the document.
     PdfLoadedPage page = lDoc.Pages[0] as PdfLoadedPage;
     bool value = true;
     //Create a redaction object
     PdfRedaction redaction = new PdfRedaction(new RectangleF(40, 40, 50, 20));
     //Set fill color for the redaction bounds
     redaction.FillColor = System.Drawing.Color.Green;
     //Add redaction object into redaction collection of loaded page
     page.Redactions.Add(redaction);
     //Perform Redaction for the loaded object and get redaction result
     List<PdfRedactionResult> results = lDoc.Redact();
     //Returns whether the bounds is redacted or not.
     bool isRedactionSuccess = results[0].IsRedactionSuccess;
     redaction.Equals(value);
     //Save and Close the document.
     lDoc.Save("sample.pdf");
     lDoc.Close(true);
    'Load the document.
    Dim lDoc As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
    Dim value As Boolean = True
    'Create a redaction object
    Dim redaction As PdfRedaction = New PdfRedaction(New RectangleF(40, 40, 50, 20))
    'Set fill color for the redaction bounds
    redaction.FillColor = Color.Green
    'Add redaction object into collection
    page.Redactions.Add(redaction)
    'Perform Redaction for the loaded object and get redaction result
    Dim results As List(Of PdfRedactionResult) = lDoc.Redact())
    'Returns whether the bounds is redacted or not
    Dim isRedactionSuccess As Boolean = results[0].IsRedactionSuccess
    'Save the document
    lDoc.Save("sample.pdf")
    lDoc.Close(True)

    PageNumber

    Gets the page number.

    Declaration
    public int PageNumber { get; }
    Property Value
    Type
    System.Int32
    Examples
     //Load the document.
     PdfLoadedDocument lDoc = new PdfLoadedDocument("input.pdf");
     //Get the first page from the document.
     PdfLoadedPage page = lDoc.Pages[0] as PdfLoadedPage;
     bool value = true;
     //Create a redaction object
     PdfRedaction redaction = new PdfRedaction(new RectangleF(40, 40, 50, 20));
     //Set fill color for the redaction bounds
     redaction.FillColor = System.Drawing.Color.Green;
     //Add redaction object into redaction collection of loaded page
     page.Redactions.Add(redaction);
     //Perform Redaction for the loaded object and get redaction result
     List<PdfRedactionResult> results = lDoc.Redact();
     //Gets the page number.
     int pageNumber = results[0].PageNumber;
     redaction.Equals(value);
     //Save and Close the document.
     lDoc.Save("sample.pdf");
     lDoc.Close(true);
    'Load the document.
    Dim lDoc As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
    Dim value As Boolean = True
    'Create a redaction object
    Dim redaction As PdfRedaction = New PdfRedaction(New RectangleF(40, 40, 50, 20))
    'Set fill color for the redaction bounds
    redaction.FillColor = Color.Green
    'Add redaction object into collection
    page.Redactions.Add(redaction)
    'Perform Redaction for the loaded object and get redaction result
    Dim results As List(Of PdfRedactionResult) = lDoc.Redact()
    'Gets the page number
    Dim pageNumber As Int = results[0].PageNumber
    'Save the document
    lDoc.Save("sample.pdf")
    lDoc.Close(True)

    RedactionBounds

    Gets the page number.

    Declaration
    public RectangleF RedactionBounds { get; }
    Property Value
    Type
    System.Drawing.RectangleF
    Examples
     //Load the document.
     PdfLoadedDocument lDoc = new PdfLoadedDocument("input.pdf");
     //Get the first page from the document.
     PdfLoadedPage page = lDoc.Pages[0] as PdfLoadedPage;
     bool value = true;
     //Create a redaction object
     PdfRedaction redaction = new PdfRedaction(new RectangleF(40, 40, 50, 20));
     //Set fill color for the redaction bounds
     redaction.FillColor = System.Drawing.Color.Green;
     //Add redaction object into redaction collection of loaded page
     page.Redactions.Add(redaction);
     //Perform Redaction for the loaded object and get redaction result
     List<PdfRedactionResult> results = lDoc.Redact();
     //Gets the redaction bounds.
     RectangleF redactionBounds = results[0].RedactionBounds;
     redaction.Equals(value);
     //Save and Close the document.
     lDoc.Save("sample.pdf");
     lDoc.Close(true);
    'Load the document.
    Dim lDoc As PdfLoadedDocument = New PdfLoadedDocument("input.pdf")
    Dim value As Boolean = True
    'Create a redaction object
    Dim redaction As PdfRedaction = New PdfRedaction(New RectangleF(40, 40, 50, 20))
    'Set fill color for the redaction bounds
    redaction.FillColor = Color.Green
    'Add redaction object into collection
    page.Redactions.Add(redaction)
    'Perform Redaction for the loaded object and get redaction result
    Dim results As List(Of PdfRedactionResult) = lDoc.Redact()
    'Gets the redaction bounds.
    Dim redactionBounds As RectangleF = results[0].RedactionBounds
    'Save the document
    lDoc.Save("sample.pdf")
    lDoc.Close(True)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved