menu

Xamarin.Android

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

    Show / Hide Table of Contents

    Class PdfEncryptionAlgorithm

    Specifies the type of encryption algorithm used.

    Inheritance
    System.Object
    PdfEncryptionAlgorithm
    Namespace: Syncfusion.Pdf.Security
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public sealed class PdfEncryptionAlgorithm : Enum
    Examples
    // Creates a new document
    PdfDocument doc = new PdfDocument();
    // Set the documents permission settings
    doc.Security.KeySize = PdfEncryptionKeySize.Key128Bit;
    doc.Security.OwnerPassword = "Syncfusion";
    doc.Security.Permissions = PdfPermissionsFlags.EditAnnotations | PdfPermissionsFlags.Print;
    doc.Security.UserPassword = "123";
    doc.Security.Algorithm = PdfEncryptionAlgorithm.AES;
    //Creates a new page and adds it as the last page of the document
    PdfPage page = doc.Pages.Add();
    PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 10);
    page.Graphics.DrawString("Permission",font,PdfBrushes.Blue, new PointF(10,10));
    doc.Save("Security.pdf");
    doc.Close(true);
    ' Creates a new document
    Dim doc As PdfDocument = New PdfDocument()
    ' Set the documents permission settings
    doc.Security.KeySize = PdfEncryptionKeySize.Key128Bit
    doc.Security.OwnerPassword = "Syncfusion"
    doc.Security.Permissions = PdfPermissionsFlags.EditAnnotations | PdfPermissionsFlags.Print
    doc.Security.UserPassword = "123"
    doc.Security.Algorithm = PdfEncryptionAlgorithm.AES
    'Creates a new page and adds it as the last page of the document
    Dim page As PdfPage = doc.Pages.Add()
    Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 10)
    page.Graphics.DrawString("Permission",font,PdfBrushes.Blue, New PointF(10,10))
    doc.Save("Security.pdf")
    doc.Close(True)

    Fields

    AES

    The encryption algorithm is AES.

    Declaration
    public const PdfEncryptionAlgorithm AES
    Field Value
    Type
    PdfEncryptionAlgorithm

    RC4

    The encryption algorithm is RC4.

    Declaration
    public const PdfEncryptionAlgorithm RC4
    Field Value
    Type
    PdfEncryptionAlgorithm
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved