The demo shows the Import and Export from/to RTF feature of the RadEditor control.
Since Q3 2014 the RadEditor control offers built-in integration with the Telerik document processing libraries that provide the import and export from/to RTF feature.
Enabling the Import and Export from/to RTF feature
To enable the Import and Export from/to RTF feature, you should reference the Telerik document processing assemblies. You can find more details about the process in the Export to DOCX and RTF article.
Importing RTF content
You can import RTF content in the Editor via its LoadRtfContent() server method and, optionally, fine tune the imported content via the Import Settings.
By default, the generated HTML content is not a full HTML page (i.e., it does not begin with the <html> tag, but with generic tags like <p>), the images are converted to a base64 string and the document styling (e.g., text colors and fonts) is stored in a <style> tag in the content.
You can get a full HTML page in the editor (i.e., content that begins with the <html> tag) by setting the Document Level Import setting to Document.
You can store the imported images in a folder under the application by setting the Images Mode Import property to External and the ImagesFolderPath property points to the desired path. You can see them in the Image Manager dialog -
You can control where the document styling is stored through the Styles Mode Import setting. If you set it to External, the generated CSS rules are written in a file if your choice (ImportedStyles.css is the file we have chosen for this demo). You can control which file from the application is used via the StylesFilePath and StylesSourcePath properties..
Exporting to an RTF file
To export the current editor content, you can call the ExportToRtf() server method and fine tune the exporting via the Export Settings.
Optionally, you can set the default font name and size for the exported document through the DefaultFontName and DefaultFontSizeInPoints Export settings.
You can also add a header and predefine its size via the PageHeader and HeaderFontSizeInPoints Export settings.
If you are interested in the Import and Export from/to DOCX feature, you can navigate to the Import and Export to DOCX demo.