.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

HtmlDocumentExporterOptions Class

Contains options for exporting the document in HTML format.

Namespace: DevExpress.XtraRichEdit.Export

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

Declaration

[ComVisible(true)]
public class HtmlDocumentExporterOptions :
    DocumentExporterOptions
<ComVisible(True)>
Public Class HtmlDocumentExporterOptions
    Inherits DocumentExporterOptions
[ComVisible(true)]
public class HtmlDocumentExporterOptions :
    DocumentExporterOptions
<ComVisible(True)>
Public Class HtmlDocumentExporterOptions
    Inherits DocumentExporterOptions
[ComVisible(true)]
public class HtmlDocumentExporterOptions :
    DocumentExporterOptions
<ComVisible(True)>
Public Class HtmlDocumentExporterOptions
    Inherits DocumentExporterOptions

Remarks

Create the HtmlDocumentExporterOptions instance and specify it as the SubDocument.GetHtmlText method parameter or handle the RichEditControl.BeforeExport or RichEditDocumentServer.BeforeExport event to specify HTML export options using the BeforeExportEventArgs.Options property of the event arguments.

For a list of supported HTML tags see the HTML Tag Support document.

Examples

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

    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

See Also