Skip to main content
All docs
V24.1

RichEditDocumentServerExtensions.ExportToImage(Document, String, RichEditImageExportOptions) Method

Exports all document pages to images. Allows you to specify image export options.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.Docs.v24.1.dll

NuGet Package: DevExpress.Document.Processor

Declaration

public static void ExportToImage(
    this Document document,
    string path,
    RichEditImageExportOptions options
)

Parameters

Name Type Description
document Document

The document currently loaded in the RichEditDocumentServer instance.

path String

The file name (including the full path and extension) for the created images.

options RichEditImageExportOptions

An object that contains image export options.

Example

The following code snippet exports the first document page to an image with the specified edge length and JPEG format:

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.Export.Image;
using DevExpress.Drawing;


using (var wordProcessor = new RichEditDocumentServer()) {
    wordProcessor.LoadDocument(@"C:\Documents\Alice.docx");

    RichEditImageExportOptions options = new RichEditImageExportOptions();
    options.Format = DXImageFormat.Jpeg;
    options.PageRange = "1";
    options.LargestEdgeLength = 1080;

    wordProcessor.Document.ExportToImage(@"C:\Documents\Image.jpeg", options);
}
See Also