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


TextFormatProvider allows you export a RadFixedDocument to plain text. Additionally, the export settings provide modification options. This article outlines the available settings.

Through the TextFormatProviderSettings class you could specify the following export settings:

  • LinesSeparator: Determines the string used to separate the lines in the document. The default value is Environment.NewLine.

  • PagesSeparator: Determines the string, which will be used to separate the pages in the document. The default value is "----------- Page{0} ------------".

Create TextFormatProviderSettings

The constructor of the TextFormatProviderSettings class has two overloads:

  • TextFormatProviderSettings(): Initializes a new instance of the class and sets the default values for its properties.

  • TextFormatProviderSettings(string linesSeparator, string pagesSeparator): Initializes a new instance of the class and sets the specified values for its properties.

Example 1 shows how to create and specify a particular setting.

Example 1: Create TextFormatProviderSettings

TextFormatProviderSettings settings = new TextFormatProviderSettings("/r/n", "Page {0}"); 

Using TextFormatProviderSettings

The Export() method of TextFormatProvider allows you to pass a TextFormatProviderSettings instance. Example 2 illustrates how to apply the settings created in Example 1, when exporting a RadFixedDocument to string.

Example 2: Apply TextFormatProviderSettings

RadFixedDocument document = CreateRadFixedDocument(); 
TextFormatProvider provider = new TextFormatProvider(); 
string text = provider.Export(document, settings); 

See Also

In this article