Document.SaveDocument(DocumentFormat, EncryptionSettings) Method
In This Article
Saves the document to a byte array in the specified file format and encrypts it with a password.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v24.2.Core.dll
NuGet Package: DevExpress.RichEdit.Core
#Declaration
byte[] SaveDocument(
DocumentFormat format,
EncryptionSettings encryptionSettings
)
#Parameters
Name | Type | Description |
---|---|---|
format | Document |
An enumeration member that specifies the output document format. |
encryption |
Encryption |
Specifies encryption settings. |
#Returns
Type | Description |
---|---|
Byte[] | A byte array that contains encrypted data in the specified format. |
#Remarks
You can use this SaveDocument method overload to store a document in an external database.
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
// ...
Document document = richEditControl1.Document;
// Specify encryption settings.
EncryptionSettings encryptionSettings = new EncryptionSettings
{
Type = EncryptionType.Strong,
Password = "password"
};
// Save the document to a byte array.
byte[] docBytes = document.SaveDocument(DocumentFormat.OpenXml, encryptionSettings);
Note
The Save
See Also