menu

Xamarin.Android

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

    Show / Hide Table of Contents

    Class PdfEncryptionKeySize

    Specifies length of the encryption key for encryption.

    Inheritance
    System.Object
    PdfEncryptionKeySize
    Namespace: Syncfusion.Pdf.Security
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public sealed class PdfEncryptionKeySize : 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;
    doc.Security.UserPassword = "123";
    //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
    doc.Security.UserPassword = "123"
    '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

    Key128Bit

    The key is 128 bit long.

    Declaration
    public const PdfEncryptionKeySize Key128Bit
    Field Value
    Type
    PdfEncryptionKeySize

    Key256Bit

    The key is 256 bit long.

    Declaration
    public const PdfEncryptionKeySize Key256Bit
    Field Value
    Type
    PdfEncryptionKeySize

    Key256BitRevision6

    The key is 256 bit long with revision 6. AES algorithm for PDF 2.0 security feature.

    Declaration
    public const PdfEncryptionKeySize Key256BitRevision6
    Field Value
    Type
    PdfEncryptionKeySize

    Key40Bit

    The key is 40 bit long.

    Declaration
    public const PdfEncryptionKeySize Key40Bit
    Field Value
    Type
    PdfEncryptionKeySize

    See Also

    PdfDocument
    PdfSecurity
    PdfPage
    PdfFont
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved