Version

Import/Export HTML (xamRichTextEditor)

Topic Overview

Purpose

This topic explains how to use the xamRichTextEditor™ control for importing and exporting HTML data.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic explains how to use document adapters for binding the xamRichTextEditor control to various data sources.

This topic explains the xamRichTextEditor control’s serialization providers.

In this topic

This topic contains the following sections:

Import/Export HTML Configuration Summary

Import/Export configuration summary chart

The following table briefly explains the configurable aspects of the xamRichTextEditor control and maps them to their respective properties.

Configurable aspect Details Methods

Import HTML content from a stream.

Export HTML content to a stream.

Note
Note

You must first include the HTML serialization provider NuGet package in your project prior to being able to use it:

Infragistics.WPF.RichTextDocument.Html

Import HTML Content

Overview

Use the LoadFromHtml extension method of the RichTextDocument to import HTML content in the xamRichTextEditor control from a stream.

Property settings

The following table maps the desired configuration to its respective property settings.

In order to: Use this method: And provide the following arguments:

Import HTML content

LoadFromHtml

  • The stream object containing the HTML format content or a string with the file path for loading the content in HTML format

  • Content loading options object of type HtmlLoadOptions, which is not required

Export HTML Content

Overview

Use the SaveToHtml extension method of the RichTextDocument to export xamRichTextEditor’s content to a stream in HTML format.

Property settings

The following table maps the desired configuration to its respective property settings.

In order to: Use this method: And provide the following arguments:

Export content in HTML format

SaveToHtml

  • The stream object into which to export the content in HTML format or a string containing the file path for saving the content in HTML format

  • Content saving options object of type HtmlSaveOptions, which is not required

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains how to import and export of plain text data using the xamRichTextEditor control.

This topic explains how to use the xamRichTextEditor control for importing and exporting RTF data.

This topic explains how to use the xamRichTextEditor control for importing and exporting DOCX formatted data.