Getting Started
This tutorial will take you through the creation of a sample application that uses RadWordsProcessing.
If you still don't have Telerik Document Processing installed, check the First Steps topic to learn how you can obtain the packages through the different suites.
Package References
The libraries support .NET 8, .NET 9 and .NET 10. .NET Standard-compatible packages are available as well. The packages for .NET Standard don't include 'Windows' in their names. (e.g. Telerik.Documents.Core). For more information check Cross-Platform Support article.
Here is a list of packages that contain the RadWordsProcessing functionality and need to be referenced in your project:
| .NET Framework | .NET Standard-compatible |
|---|---|
| Telerik.Windows.Documents.Core | Telerik.Documents.Core |
| Telerik.Windows.Documents.Flow | Telerik.Documents.Flow |
| Telerik.Windows.Documents.DrawingML | Telerik.Documents.DrawingML |
| If you need to import DOC or DOT files, you will need to refer the following packages: | |
| Telerik.Windows.Documents.Flow.FormatProviders.Doc | Telerik.Documents.Flow.FormatProviders.Doc |
| If you need to export documents to PDF format, you will need to refer the following packages: | |
| Telerik.Windows.Documents.Flow.FormatProviders.Pdf | Telerik.Documents.Flow.FormatProviders.Pdf |
| Telerik.Windows.Documents.Fixed | Telerik.Documents.Fixed |
| - |
Telerik.Documents.ImageUtils*
This package is not available in UI for Xamarin. |
| To describe different colors, shapes and other properties, RadWordsProcessing depends on the listed below .NET assemblies, which you should also refer in your project: | |
| WindowsBase.dll | - |
| PresentationCore.dll | - |
| PresentationFramework.dll | - |
* The Telerik.Documents.ImageUtils package is needed when exporting to PDF format a document containing images different than Jpeg and Jpeg2000 or ImageQuality different than High.
The Telerik.Documents.ImageUtils package depends on SkiaSharp. In order to use this package, you will need to add a reference to SkiaSharp. With the R2 2023 changes SkiaSharp replaced ImageSharp as the required dependency.
Creating RadFlowDocument from Code
Here is how to create a RadFlowDocument and insert some text content with the help of RadFlowDocumentEditor.
Example 1: Create RadFlowDocument programmatically
RadFlowDocument document = new RadFlowDocument();
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);
editor.InsertText("Hello world!");
You need to add using directive to the following namespaces:
- Telerik.Windows.Documents.Flow.Model
- Telerik.Windows.Documents.Flow.Model.Editing
Exporting RadFlowDocument to Docx
Exporting the document to Docx file can be achieved with the DocxFormatProvider. Here is how to create a provider instance and save a document with it:
Example 2: Export RadFlowDocument to Docx
using (Stream output = new FileStream("output.docx", FileMode.OpenOrCreate))
{
DocxFormatProvider provider = new DocxFormatProvider();
provider.Export(document, output);
}