Back to Devexpress

RichEditControl.SaveDocument(Stream, DocumentFormat, EncryptionSettings) Method

wpf-devexpress-dot-xpf-dot-richedit-dot-richeditcontrol-dot-savedocument-x28-system-dot-io-dot-stream-devexpress-dot-xtrarichedit-dot-documentformat-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-encryptionsettings-x29.md

latest2.4 KB
Original Source

RichEditControl.SaveDocument(Stream, DocumentFormat, EncryptionSettings) Method

Saves the document to a file, specifying the document’s format and encryption settings.

Namespace : DevExpress.Xpf.RichEdit

Assembly : DevExpress.Xpf.RichEdit.v25.2.dll

NuGet Package : DevExpress.Wpf.RichEdit

Declaration

csharp
public void SaveDocument(
    Stream stream,
    DocumentFormat documentFormat,
    EncryptionSettings encryptionSettings
)
vb
Public Sub SaveDocument(
    stream As Stream,
    documentFormat As DocumentFormat,
    encryptionSettings As EncryptionSettings
)

Parameters

NameTypeDescription
streamStream

The stream used to output the document.

| | documentFormat | DocumentFormat |

Indicates the document format.

| | encryptionSettings | EncryptionSettings |

Document encryption settings.

|

Remarks

Use this SaveDocument method overload to encrypt a document with a password, as shown below:

csharp
EncryptionSettings encryptionOptions = new EncryptionSettings();
encryptionSettings.Type = EncryptionType.Strong;
encryptionSettings.Password = "12345";

richEditControl.SaveDocument(stream, documentFormat, encryptionSettings);
vb
Dim encryptionSettings As encryptionSettings = New encryptionSettings()
encryptionSettings.Type = EncryptionType.Strong
encryptionSettings.Password = "12345"
richEditControl.SaveDocument(stream, documentFormat, encryptionSettings)

See Also

RichEditControl Class

RichEditControl Members

DevExpress.Xpf.RichEdit Namespace