New to Telerik Document Processing? Start a free 30-day trial
Using TextFormatProvider
Updated on Jun 3, 2026
TextFormatProvider exports a RadFixedDocument to plain text format while preserving the document structure.
To use TextFormatProvider, add references to the following packages:
- Telerik.Windows.Documents.Core
- Telerik.Windows.Documents.Fixed
Export
To export a document to plain text, use the Export() method of TextFormatProvider.
Example 1 shows how to use TextFormatProvider to export a RadFixedDocument to a string.
Example 1: Export RadFixedDocument to string
C#
Telerik.Windows.Documents.Fixed.FormatProviders.Text.TextFormatProvider textFormatProvider =
new Telerik.Windows.Documents.Fixed.FormatProviders.Text.TextFormatProvider();
RadFixedDocument document = new RadFixedDocument();
using (RadFixedDocumentEditor radFixedDocumentEditor = new RadFixedDocumentEditor(document))
{
radFixedDocumentEditor.InsertLine("Sample line.");
radFixedDocumentEditor.InsertRun("Sample run.");
}
string documentAsText = textFormatProvider.Export(document, TextFormatProviderSettings.Default, TimeSpan.FromSeconds(10));