Version

Import/Export RTF (xamRichTextEditor)

Topic Overview

Purpose

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

Required background

The following topic is a prerequisite to understanding this topic:

Topic Purpose

This topic explains the xamRichTextEditor control’s serialization providers.

Import/Export Rich Text Format 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 rich text format content from a stream.

Export rich text format content to a stream.

Note
Note

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

Infragistics.WPF.RichTextDocument.Rtf

Import Rich Text Format Content

Overview

Use the LoadFromRtf extension method of the RichTextDocument for importing rich text format 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 rich text format content

LoadFromRtf

  • The stream object containing the rich text format content

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

Export Rich Text Format Content

Overview

Use the SaveToRtf extension method of the RichTextDocument for exporting xamRichTextEditor’s rich text format content to 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:

Export content in rich text format

SaveToRtf

  • The stream object into which to export the content in rich text format

  • Content saving options object of type RtfSaveOptions, 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 DOCX formatted data.