# Create Your First DOCX-to-PDF App with Telerik Document Processing

This getting started guide shows how to create a simple application that uses **Telerik Document Processing** to generate a DOCX document and then export the same document to PDF.

The Telerik Document Processing libraries in this guide are UI-independent and work across .NET desktop, web, mobile, client-side, server-side, and cloud applications. The example uses `RadWordsProcessing` to create the document content and `PdfFormatProvider` to export it.

## Step 1: Locate or Install Telerik Document Processing

Install `Telerik.Licensing` in the same project where you add the Telerik Document Processing packages.

Telerik Document Processing is available with several Telerik UI component bundles, so the libraries may already be present on your machine. If you already installed one of the supported Telerik UI suites, use the following table to find the installation instructions and the default package location for that suite:

> tip For new development, the recommended installation path is NuGet. For current feed options and setup steps, see the [NuGet package installation guide](https://www.telerik.com/document-processing-libraries/documentation/getting-started/installation/install-nuget-packages).

| UI Components suite | Installation instructions                                                                                                                                                                                              | Default location of the Document Processing packages                                                                                                                                                                                                                 |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UI for ASP.NET AJAX | <a href="https://docs.telerik.com/devtools/aspnet-ajax/installation/which-file-do-i-need-to-install" target="_blank">Installing Telerik UI for ASP.NET AJAX</a>                                                        | <ul><li>`C:\Program Files (x86)\Progress\Telerik UI for ASP.NET AJAX [version]\AdditionalLibraries\Bin40`</li><li>`C:\Program Files (x86)\Progress\Telerik UI for ASP.NET AJAX [version]\AdditionalLibraries\Bin45`</li></ul>                                        |
| UI for ASP.NET MVC  | <a href="https://docs.telerik.com/kendo-ui/aspnet-mvc/introduction#installation" target="_blank">Installing Telerik UI for ASP.NET MVC</a>                                                                             | <ul><li>`C:\Program Files (x86)\Progress\Telerik UI for ASP.NET MVC [version]\dpl\net40`</li><li>`C:\Program Files (x86)\Progress\Telerik UI for ASP.NET MVC [version]\dpl\netstandard`</li></ul>                                                                    |
| UI for ASP.NET Core | <a href="https://docs.telerik.com/aspnet-core/getting-started/installation/document-processing" target="_blank">Installing Telerik UI for ASP.NET Core</a>                                                             | Install the libraries as NuGet packages. See [Install using NuGet Packages](https://www.telerik.com/document-processing-libraries/documentation/getting-started/installation/install-nuget-packages) for the current package source and feed configuration steps.    |
| UI for Blazor       | <a href="https://docs.telerik.com/blazor-ui/common-features/document-processing" target="_blank">Installing Telerik UI for Blazor</a>                                                                                  | Install the libraries as NuGet packages. See [Install using NuGet Packages](https://www.telerik.com/document-processing-libraries/documentation/getting-started/installation/install-nuget-packages) for the current package source and feed configuration steps.    |
| UI for WPF          | <a href="https://docs.telerik.com/devtools/wpf/installation-and-deployment/installing-telerik-ui-on-your-computer/installation-installing-which-file-do-i-need.html" target="_blank">Installing Telerik UI for WPF</a> | <ul><li>`C:\Program Files (x86)\Progress\Telerik UI for WPF [version]\Binaries`</li><li>`C:\Program Files (x86)\Progress\Telerik UI for WPF [version]\Binaries.NoXaml`</li></ul>                                                                                     |
| UI for WinForms     | <a href="https://docs.telerik.com/devtools/winforms/installation-deployment-and-distribution/installing-on-your-computer" target="_blank">Installing Telerik UI for WinForms</a>                                       | <ul><li>`C:\Program Files (x86)\Progress\Telerik UI for WinForms [version]\Bin40`</li><li>`C:\Program Files (x86)\Progress\Telerik UI for WinForms [version]\Bin50`</li><li>`C:\Program Files (x86)\Progress\Telerik UI for WinForms [version]\BinNetCore`</li></ul> |
| UI for WinUI        | <a href="https://docs.telerik.com/devtools/winui/installation-and-deployment/installationsteps" target="_blank">Installing Telerik UI for WinUI</a>                                                                    | `C:\Program Files (x86)\Progress\Telerik UI for WinUI [version]\DPL`                                                                                                                                                                                                 |
| UI for .NET MAUI    | <a href="https://docs.telerik.com/devtools/maui/installation/download-product-files" target="_blank">Installing Telerik UI for .NET MAUI</a>                                                                           | `[installation_path]/Binaries/Shared`                                                                                                                                                                                                                                |

## Step 2: Create a Console Application in Visual Studio

This guide uses a console application because Telerik Document Processing is UI-independent.

Before you begin, install Visual Studio with the .NET development tools and confirm that your project can restore NuGet packages and write files to its output folder.

Open Microsoft Visual Studio and create a new console project. Create the project with a .NET Framework or .NET 8, .NET 9 and .NET 10 target framework supported by Telerik Document Processing. For cross-platform projects, use the .NET Standard package variants described in [Install using NuGet Packages](https://www.telerik.com/document-processing-libraries/documentation/getting-started/installation/install-nuget-packages).

**Visual Studio create console project workflow for a Telerik Document Processing sample**

Use the Visual Studio path shown in the following image to create the console application.

![Visual Studio New Project dialog with the Console App template selected](https://www.telerik.com/document-processing-libraries/documentation/assets/d945956f21d2ed09b31c0c984b689df1/visualstudio_newproject_console3.gif)

## Step 3: Add the Required Telerik Document Processing Packages

This sample uses [RadWordsProcessing](https://www.telerik.com/document-processing-libraries/documentation/libraries/radwordsprocessing/overview) to create the DOCX file. Add the required packages to the console project before you add the sample code:

1. Add the packages that provide the `RadWordsProcessing` document model and DOCX functionality.

   For a .NET Framework project:

   * `Telerik.Windows.Documents.Core`
   * `Telerik.Windows.Documents.Flow`

   For a cross-platform .NET project:

   * `Telerik.Documents.Core`
   * `Telerik.Documents.Flow`

2. Add the package that exports the generated document to PDF.

   For a .NET Framework project:

   * `Telerik.Windows.Documents.Flow.FormatProviders.Pdf`
   * `Telerik.Windows.Documents.Fixed`

   For a cross-platform .NET project:

   * `Telerik.Documents.Flow.FormatProviders.Pdf`
   * `Telerik.Documents.Fixed`

You can find the complete Telerik Document Processing package list in the [available NuGet packages reference](https://www.telerik.com/document-processing-libraries/documentation/getting-started/installation/nuget-packages).

## Step 4: Create a RadFlowDocument

Use the following snippet to create the `RadFlowDocument` instance that the sample exports later.

**Create a RadFlowDocument and insert the initial text content**

```C#
Telerik.Documents.Flow.Model.RadFlowDocument document = new Telerik.Documents.Flow.Model.RadFlowDocument();
Telerik.Documents.Flow.Model.Editing.RadFlowDocumentEditor editor = new Telerik.Documents.Flow.Model.Editing.RadFlowDocumentEditor(document);
editor.InsertText("Hello world!");
```

## Step 5: Import an Existing DOCX File

Use this optional step if you want to start from an existing DOCX file instead of building all document content in code.

**Import an existing DOCX file into a RadFlowDocument**

```C#
Telerik.Documents.Flow.Model.RadFlowDocument document = new Telerik.Documents.Flow.Model.RadFlowDocument();
Telerik.Documents.Flow.FormatProviders.Docx.DocxFormatProvider docxProvider = new Telerik.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();
using (Stream input = new FileStream("input.docx", FileMode.Open))
{
    document = docxProvider.Import(input, TimeSpan.FromSeconds(10));
}
```

## Step 6: Export the Generated Document

### Export the RadFlowDocument to DOCX

Use the [DocxFormatProvider for DOCX export](https://www.telerik.com/document-processing-libraries/documentation/libraries/radwordsprocessing/formats-and-conversion/word-file-formats/docx/docxformatprovider) to export the `RadFlowDocument` as a DOCX file. The following snippet creates the provider instance and exports the generated document to the `bin` folder of the current project.

**Export a RadFlowDocument to a DOCX file**

```C#
using (Stream output = new FileStream("output.docx", FileMode.OpenOrCreate))
{
    Telerik.Documents.Flow.FormatProviders.Docx.DocxFormatProvider docxProvider = new Telerik.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();
    docxProvider.Export(document, output, TimeSpan.FromSeconds(10));
}
```

### Export the RadFlowDocument to PDF

Use the [PdfFormatProvider for PDF export](https://www.telerik.com/document-processing-libraries/documentation/libraries/radpdfprocessing/formats-and-conversion/pdf/pdfformatprovider/pdfformatprovider) to export the same `RadFlowDocument` to a PDF file.

**Export a RadFlowDocument to a PDF file**

```C#
using (Stream output = File.OpenWrite("Output.pdf"))
{
    Telerik.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider flowPdfProvider = new Telerik.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
    flowPdfProvider.Export(document, output, TimeSpan.FromSeconds(10));
}
```

## Step 7: Run the Project and Verify the Output

Run the console application and verify that the `bin` folder contains both generated files. Open each file and confirm that it contains the text from the `RadFlowDocument`.

**Generated DOCX and PDF files in the Telerik Document Processing sample output folder**

![File Explorer showing generated DOCX and PDF files in the project bin folder](https://www.telerik.com/document-processing-libraries/documentation/assets/2c13d0389f60e3f5ab5e901736db7246/finalresult.png)

## Next Steps

After you complete this first sample, continue with the following articles to explore editing, merging, inserting, and other document-processing tasks.

* [Explore Document Processing features and examples](https://www.telerik.com/document-processing-libraries/documentation/getting-started/explore-features)
* [Find additional Document Processing guidance](https://www.telerik.com/document-processing-libraries/documentation/getting-started/next-steps)

## See Also

* [Review Document Processing system requirements](https://www.telerik.com/document-processing-libraries/documentation/getting-started/installation/system-requirements)
* [Install Telerik Document Processing on your computer](https://www.telerik.com/document-processing-libraries/documentation/getting-started/installation/installing-on-your-computer)
* <a href="https://github.com/telerik/document-processing-sdk" target="_blank">Browse Telerik Document Processing SDK examples</a>
* [Review Document Processing library distribution across .NET versions](https://www.telerik.com/document-processing-libraries/documentation/knowledge-base/distribute-telerik-document-processing-libraries-net-versions)
