All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Document.SaveDocument(DocumentFormat, EncryptionSettings) Method

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.v20.2.Core.dll

Declaration

byte[] SaveDocument(
    DocumentFormat format,
    EncryptionSettings encryptionSettings
)

Parameters

Name Type Description
format DocumentFormat

An enumeration member that specifies the output document format.

encryptionSettings EncryptionSettings

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 SaveDocument method call does not change the Modified property value.

See Also