Skip to main content
All docs
V22.1
.NET Framework 4.5.2+

Document.SaveDocument(DocumentFormat) Method

Saves the document to a byte array in the specified file format.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v22.1.Core.dll

Declaration

byte[] SaveDocument(
    DocumentFormat format
)

Parameters

Name Type Description
format DocumentFormat

An enumeration member that specifies the output document format.

Returns

Type Description
Byte[]

A byte array that contains 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 = richEditControl.Document;

// Save a document to a byte array to store it in a database.
byte[] docBytes = document.SaveDocument(DocumentFormat.OpenXml);

// ...

// Load the saved document from a byte array.
document.LoadDocument(docBytes, DocumentFormat.OpenXml);

Note

The SaveDocument method call does not change the Modified property value.

See Also