Back to Devexpress

RichEditDocumentServer.SaveDocument(DocumentFormat) Method

officefileapi-devexpress-dot-xtrarichedit-dot-richeditdocumentserver-dot-savedocument-x28-devexpress-dot-xtrarichedit-dot-documentformat-x29.md

latest2.5 KB
Original Source

RichEditDocumentServer.SaveDocument(DocumentFormat) Method

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

Namespace : DevExpress.XtraRichEdit

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public byte[] SaveDocument(
    DocumentFormat documentFormat
)
vb
Public Function SaveDocument(
    documentFormat As DocumentFormat
) As Byte()

Parameters

NameTypeDescription
documentFormatDocumentFormat

An enumeration member that specifies the output document format.

|

Returns

TypeDescription
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.

csharp
using DevExpress.XtraRichEdit;
// ...

RichEditDocumentServer wordProcessor = new RichEditDocumentServer()

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

// ...

// Load the saved document from a byte array.
wordProcessor.LoadDocument(docBytes, DocumentFormat.Docx);
vb
Imports DevExpress.XtraRichEdit
' ...

Dim wordProcessor As New RichEditDocumentServer()

' Save a document to a byte array to store it in a database.
Dim docBytes() As Byte = wordProcessor.SaveDocument(DocumentFormat.Docx)

' ...

' Load the saved document from a byte array.
wordProcessor.LoadDocument(docBytes, DocumentFormat.Docx)

Implements

SaveDocument(DocumentFormat)

See Also

RichEditDocumentServer Class

RichEditDocumentServer Members

DevExpress.XtraRichEdit Namespace