Skip to main content
All docs
V25.1
  • PdfExportOptions.EncryptionOptions Property

    Gets PDF encryption options.

    Namespace: DevExpress.Docs.Presentation.Export

    Assembly: DevExpress.Docs.Presentation.v25.1.dll

    NuGet Package: DevExpress.Docs.Presentation

    Declaration

    public EncryptionOptions EncryptionOptions { get; }

    Property Value

    Type Description
    EncryptionOptions

    An object that contains encryption options.

    Example

    The following code snippet specifies available encryption settings:

    using DevExpress.Docs.Pdf;
    using DevExpress.Docs.Presentation;
    using DevExpress.Docs.Presentation.Export;
    
    using (var presentation = new Presentation(File.ReadAllBytes(@"C:\Documents\Presentation.pptx")))
    {
        var options = new PdfExportOptions();
        // Specify operation restrictions:
        options.EncryptionOptions.DataExtractionPermissions =
            DocumentDataExtractionPermissions.NotAllowed;
        options.EncryptionOptions.PrintPermissions =
            DocumentPrintPermissions.LowQuality;
        options.EncryptionOptions.ModificationPermissions = DocumentModificationPermissions.NotAllowed;
    
        // Set user and owner passwords:
        options.EncryptionOptions.UserPassword = "userPassword";
        options.EncryptionOptions.OwnerPassword = "ownerPassword";
    
        // Specify encryption algorithm:
        options.EncryptionOptions.Algorithm = EncryptionAlgorithm.AES256;
    
        presentation.ExportToPdf(new FileStream("C:\\Documents\\Presentation.pdf", FileMode.Create, FileAccess.ReadWrite), options);
    }
    
    See Also