Back to Devexpress

HtmlExporter Class

officefileapi-devexpress-dot-xtrarichedit-dot-export-dot-html-bc29c304.md

latest3.0 KB
Original Source

HtmlExporter Class

Represents an object used to export the document content in HTML format.

Namespace : DevExpress.XtraRichEdit.Export.Html

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public class HtmlExporter :
    HtmlExporterBase,
    IHtmlExporter
vb
Public Class HtmlExporter
    Inherits HtmlExporterBase
    Implements IHtmlExporter

Remarks

The HtmlExporterBase.Export method of the HtmlExporter object is used to accomplish the export task, as illustrated in the following code snippet:

View Example

csharp
using DevExpress.XtraRichEdit.Export;
using DevExpress.XtraRichEdit.Export.Html;
using DevExpress.XtraRichEdit.Commands;
using DevExpress.Office.Services;
    private void ExportHtml(out string stringHtml, HtmlExporter exporter, string fileName) {
        stringHtml = String.Empty;
        HtmlDocumentExporterOptions options = new HtmlDocumentExporterOptions();
        options.ExportRootTag = htmlExportType;
        options.CssPropertiesExportType = cssExportType;
        options.TargetUri = Path.GetFileNameWithoutExtension(fileName);
        exporter = new HtmlExporter(this.richEditControl1.Model, options);
        stringHtml = exporter.Export();
    }
vb
Imports DevExpress.XtraRichEdit.Export
Imports DevExpress.XtraRichEdit.Export.Html
Imports DevExpress.XtraRichEdit.Commands
Imports DevExpress.Office.Services
    Private Sub ExportHtml( ByRef stringHtml As String, ByVal exporter As HtmlExporter, ByVal fileName As String)
        stringHtml = String.Empty
        Dim options As New HtmlDocumentExporterOptions()
        options.ExportRootTag = htmlExportType
        options.CssPropertiesExportType = cssExportType
        options.TargetUri = Path.GetFileNameWithoutExtension(fileName)
        exporter = New HtmlExporter(Me.richEditControl1.Model, options)
        stringHtml = exporter.Export()
    End Sub

Inheritance

Object HtmlExporterBase HtmlExporter

See Also

HtmlExporter Members

HtmlDocumentExporterOptions

BeforeExport

DevExpress.XtraRichEdit.Export.Html Namespace