menu

Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfRedactionExtension - Xamarin.Android API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfRedactionExtension

    Represents PdfRedactionExtension class

    Inheritance
    System.Object
    PdfRedactionExtension
    Namespace: Syncfusion.Pdf.Redaction
    Assembly: Syncfusion.Pdf.Imaging.Portable.dll
    Syntax
    public static class PdfRedactionExtension : Object

    Methods

    AddRedaction(PdfLoadedPage, PdfRedaction)

    Add redaction to the PDF page.

    Declaration
    public static void AddRedaction(this PdfLoadedPage page, PdfRedaction redact)
    Parameters
    Type Name Description
    PdfLoadedPage page
    PdfRedaction redact
    Examples
    //Load the existing PDF document
    PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream);
    //Create a redaction object
    PdfRedaction redaction = new PdfRedaction(new RectangleF(343, 167, 100, 25), Color.Black);
    //Add redaction object into redaction collection of loaded page
    page.AddRedaction(redaction);
    //Redact the contents from PDF document. 
    loadedDocument.Redact();
    //Creating the stream object
    MemoryStream stream = new MemoryStream();
    //Save the document into stream.
    loadedDocument.Save(stream);
    //Close the documents.
    loadedDocument.Close(true);
    'Load the existing PDF document
    Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument(docStream)
    'Create a redaction object
    Dim redaction As PdfRedaction = New PdfRedaction(New RectangleF(343, 167, 100, 25), Color.Black)
    'Add redaction object into redaction collection of loaded page
    page.AddRedaction(redaction)
    'Redact the contents from PDF document. 
    loadedDocument.Redact()
    'Creating the stream object
    Dim stream As MemoryStream = New MemoryStream()
    'Save the document into stream.
    loadedDocument.Save(stream)
    'Close the document.
    loadedDocument.Close(True)

    Redact(PdfLoadedDocument)

    Redact the contents from PDF document.

    Declaration
    public static List<PdfRedactionResult> Redact(this PdfLoadedDocument ldoc)
    Parameters
    Type Name Description
    PdfLoadedDocument ldoc
    Returns
    Type
    System.Collections.Generic.List<PdfRedactionResult>
    Examples
    //Load the existing PDF document
    PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream);
    //Create a redaction object
    PdfRedaction redaction = new PdfRedaction(new RectangleF(343, 167, 100, 25), Color.Black);
    //Add redaction object into redaction collection of loaded page
    page.AddRedaction(redaction);
    This method returns a list of redaction results.
    loadedDocument.Redact();
    //Creating the stream object
    MemoryStream stream = new MemoryStream();
    //Save the document into stream.
    loadedDocument.Save(stream);
    //Close the documents.
    loadedDocument.Close(true);
    'Load the existing PDF document
    Dim loadedDocument As PdfLoadedDocument = New PdfLoadedDocument(docStream)
    'Create a redaction object
    Dim redaction As PdfRedaction = New PdfRedaction(New RectangleF(343, 167, 100, 25), Color.Black)
    'Add redaction object into redaction collection of loaded page
    page.AddRedaction(redaction)
    'This method returns a list of redaction results. 
    loadedDocument.Redact()
    'Creating the stream object
    Dim stream As MemoryStream = New MemoryStream()
    'Save the document into stream.
    loadedDocument.Save(stream)
    'Close the document.
    loadedDocument.Close(True)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved