officefileapi-devexpress-dot-pdf-dot-pdfencryptionoptions-51364874.md
Specifies an algorithm to encrypt a PDF document.
Namespace : DevExpress.Pdf
Assembly : DevExpress.Pdf.v25.2.Core.dll
NuGet Package : DevExpress.Pdf.Core
public PdfEncryptionAlgorithm Algorithm { get; set; }
Public Property Algorithm As PdfEncryptionAlgorithm
| Type | Description |
|---|---|
| PdfEncryptionAlgorithm |
A PdfEncryptionAlgorithm enumeration value that specifies an encryption algorithm.
|
Available values:
| Name | Description |
|---|---|
| ARC4 |
Use the 128-bit ARC4 algorithm.
| | AES128 |
Use the 128-bit AES (Advanced Encryption Standard) algorithm.
| | AES256 |
Use the 256-bit AES (Advanced Encryption Standard) algorithm.
|
You can access this nested property as listed below:
| Object Type | Path to Algorithm |
|---|---|
| PdfSaveOptions |
.EncryptionOptions .Algorithm
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the Algorithm property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
pdf-document-api-protect-document-with-password/CS/PDFPasswordProtection/Program.cs#L25
// Specify the 256-bit AES encryption algorithm.
encryptionOptions.Algorithm = PdfEncryptionAlgorithm.AES256;
office-file-api-in-web-api-app/CS/Controllers/PdfController.cs#L78
encryptionOptions.UserPasswordString = password;
encryptionOptions.Algorithm = PdfEncryptionAlgorithm.AES256;
processor.SaveDocument(result, new PdfSaveOptions() { EncryptionOptions = encryptionOptions });
pdf-document-api-protect-document-with-password/VB/PDFPasswordProtection/Program.vb#L22
' Specify the 256-bit AES encryption algorithm.
encryptionOptions.Algorithm = DevExpress.Pdf.PdfEncryptionAlgorithm.AES256
' Save the protected document with encryption settings.
See Also