Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

HtmlDocumentExporterOptions Class

Contains options to export the document in HTML format.

Namespace: DevExpress.XtraRichEdit.Export

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

NuGet Package: DevExpress.RichEdit.Core

#Declaration

[ComVisible(true)]
public class HtmlDocumentExporterOptions :
    DocumentExporterOptions

The following members return HtmlDocumentExporterOptions objects:

#Remarks

Use the HtmlDocumentExporterOptions class object in the following members:

For a list of supported HTML tags, refer to the following help topic: HTML Tag Support.

#Example

The following code snippet illustrates how to obtain HTML text using the SubDocument.GetHtmlText method specifying export options with the HtmlDocumentExporterOptions object.

View Example

    frmBrowser myBrowser = new frmBrowser();
    DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions myExportOptions =
        new DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions();
    myExportOptions.Encoding = System.Text.Encoding.Unicode;

    if (this.richEditControl.Document.Selection.Length > 0) {
        DevExpress.XtraRichEdit.API.Native.DocumentRange selection = richEditControl.Document.Selection;
        DevExpress.XtraRichEdit.API.Native.SubDocument doc = selection.BeginUpdateDocument();
        myBrowser.SetHtml(doc.GetHtmlText(selection, null, myExportOptions));
        selection.EndUpdateDocument(doc);
    }
    else {
        myBrowser.SetHtml(richEditControl.Document.GetHtmlText(richEditControl.Document.Range, null, myExportOptions));
    }

    myBrowser.Show();
}

#Implements

DevExpress.Office.ISupportsCopyFrom<IExporterOptions>
See Also