Skip to main content
A newer version of this page is available. .

HtmlDocumentExporterOptions.CssPropertiesExportType Property

Gets or sets how the style sheets properties are exported.

Namespace: DevExpress.XtraRichEdit.Export

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

Declaration

public CssPropertiesExportType CssPropertiesExportType { get; set; }

Property Value

Type Description
CssPropertiesExportType

A CssPropertiesExportType enumeration value specifying the export type.

Available values:

Name Description
ExportToCurrentFile

Obsolete. Saves style sheets incorporated in the main document.

ExportToSeparateFile

Obsolete. Saves style sheets in a separate CSS file.

Style

CSS is included in a <STYLE> tag.

CSS is included as a link to an external CSS-file.

Inline

CSS is embedded by placing it as an attribute to an HTML tag.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to CssPropertiesExportType
WinForms Controls RichTextEditDocumentExportOptions
.Mht.CssPropertiesExportType
Office File API RichEditDocumentExportOptions
.Mht.CssPropertiesExportType

Remarks

Handle the RichEditControl.BeforeExport or RichEditDocumentServer.BeforeExport event and specify the css export type - that is, the location of stylesheets - via the BeforeExportEventArgs.Options property of the event arguments.

The following code snippet illustrates this:

Note

A complete sample project is available at How to save the text of a document range in different formats.

private void richEditControl_BeforeExport(object sender, DevExpress.XtraRichEdit.BeforeExportEventArgs e) {
    DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions options = e.Options as DevExpress.XtraRichEdit.Export.HtmlDocumentExporterOptions;
    if (options != null) 
{
        options.CssPropertiesExportType = DevExpress.XtraRichEdit.Export.Html.CssPropertiesExportType.Link;
        options.HtmlNumberingListExportFormat = DevExpress.XtraRichEdit.Export.Html.HtmlNumberingListExportFormat.HtmlFormat;
        options.TargetUri = Path.GetFileNameWithoutExtension(this.fileName);
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the CssPropertiesExportType property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also