Available for: UI for ASP.NET MVC | UI for ASP.NET AJAX | UI for Blazor | UI for WPF | UI for WinForms | UI for Silverlight | UI for Xamarin | UI for WinUI | UI for ASP.NET Core | UI for .NET MAUI

New to Telerik Document Processing? Download free 30-day trial

Using TextFormatProvider

TextFormatProvider makes it easy to export RadFixedDocument to plain text format, preserving the document structure.

All you have to do in order to use TextFormatProvider is add references to the assemblies listed below:

  • Telerik.Windows.Documents.Core.dll
  • Telerik.Windows.Documents.Fixed.dll


In order to export a document to plain text, you need to use the Export() method of TextFormatProvider.

Example 1 shows how to use TextFormatProvider to export RadFixedDocument to a string.

Example 1: Export RadFixedDocument to string

Telerik.Windows.Documents.Fixed.FormatProviders.Text.TextFormatProvider provider = new Telerik.Windows.Documents.Fixed.FormatProviders.Text.TextFormatProvider(); 
RadFixedDocument document = CreateRadFixedDocument();// CreateRadFixedDocument() is a custom method that creates a simple instance of RadFixedDocument. You can replace it with the instance you would like to export.  
string documentContent = provider.Export(document); 

See Also

In this article