title | page_title | slug | tags | published | position |
---|---|---|---|---|---|
First Steps |
First Steps |
getting-started-first-steps |
get,started,first,steps |
true |
1 |
In this getting started guide, we create a simple application that uses the Telerik Document Processing libraries to create a DOCX document and then export it as a PDF file.
The Telerik Document Processing libraries that we use in this guide are UI-independent and cover all .NET technologies, from desktop and web to mobile. They can also be deployed in client, server-side and cloud apps.
important Please install <PackageReference Include="Telerik.Licensing" Version="1.*" />.
Since we distribute Telerik Document Processing libraries as an addition to several Telerik UI component bundles, chances are that the libraries are already installed on your system. In this case, all you need is to locate them. The table below provides links to the installation instructions for each of the Telerik UI component suites that give you access to the Telerik Document Processing libraries. If the standard installation of your Telerik UI component suite includes the Document Processing assemblies, the table also shows their default location.
tipRegardless of the Telerik UI components suite that you use, you can always get the Document Processing assemblies as NuGet packages from the [Telerik NuGet server]({%slug installation-nuget-packages%}).
caution The old https://nuget.telerik.com/nuget server is deprecated and we encourage our clients to switch to the v3 API. The new v3 API is faster, lighter, and reduces the number of requests from NuGet clients. The NuGet v2 server at https://nuget.telerik.com/nuget will be sunset in November 2024. The new v3 protocol offers faster package searches and restores, improved security, and more reliable infrastructure. To redirect your feed to the NuGet v3 protocol, all you have to do is to change your NuGet package source URL to https://nuget.telerik.com/v3/index.json.
UI Components suite | Installation instructions | Default location of the Document Processing assemblies |
---|---|---|
UI for ASP.NET AJAX | Installing Telerik UI for ASP.NET AJAX |
|
UI for ASP.NET MVC | Installing Telerik UI for ASP.NET MVC |
|
UI for ASP.NET Core | Installing Telerik UI for ASP.NET Core | The Telerik Document Processing libraries are available as NuGet packages on the Telerik NuGet server: https://nuget.telerik.com/v3/index.json. |
UI for Blazor | Installing Telerik UI for Blazor | The Telerik Document Processing libraries are available as NuGet packages on the Telerik NuGet server: https://nuget.telerik.com/v3/index.json. |
UI for WPF | Installing Telerik UI for WPF |
|
UI for Silverlight | Installing Telerik UI for Silverlight |
|
UI for WinForms | Installing Telerik UI for WinForms |
|
UI for Xamarin | Installing Telerik UI for Xamarin | [installation_path]\Binaries\Portable |
UI for WinUI | Installing Telerik UI for WinUI | C:\Program Files (x86)\Progress\Telerik UI for WinUI [version]\DPL |
UI for .NET MAUI | Installing Telerik UI for .NET MAUI | [installation_path]/Binaries/Shared |
As we are going to create a UI-Independent example, we will use a console project for this guide:
- Open Microsoft Visual Studio and create a new console project. It could be a .NET Framework, .NET Standard, .NET 6/.NET 8/.NET 9 project.
This sample application will use [RadWordsProcessing]({%slug radwordsprocessing-overview%}). In this step, we must add the required assemblies.
-
Reference the assemblies that provide the RadWordsProcessing functionality:
For .NET Framework project:
- Telerik.Windows.Documents.Core.dll
- Telerik.Windows.Documents.Flow.dll
- Telerik.Windows.Zip.dll
For .NET Standard (.NET Core/.NET 6/.NET 8/.NET 9) project:
- Telerik.Documents.Core.dll
- Telerik.Documents.Flow.dll
- Telerik.Zip.dll
-
Reference the assembly that allows you to export the content as a PDF file:
For .NET Framework project:
- Telerik.Windows.Documents.Flow.FormatProviders.Pdf.dll
For .NET Standard (.NET Core/.NET 6/.NET 8/.NET 9) project:
- Telerik.Documents.Flow.FormatProviders.Pdf.dll
The Document Processing assemblies for .NET 6/.NET 8/.NET 9 don't contain "Windows" in their names.
{{region cs-radwordsprocessing-getting-started_0}} Telerik.Windows.Documents.Flow.Model.RadFlowDocument document = new Telerik.Windows.Documents.Flow.Model.RadFlowDocument(); Telerik.Windows.Documents.Flow.Model.Editing.RadFlowDocumentEditor editor = new Telerik.Windows.Documents.Flow.Model.Editing.RadFlowDocumentEditor(document); editor.InsertText("Hello world!"); {{endregion}}
{{region cs-radwordsprocessing-getting-started_0}} Dim document As Telerik.Windows.Documents.Flow.Model.RadFlowDocument = New Telerik.Windows.Documents.Flow.Model.RadFlowDocument() Dim editor As Telerik.Windows.Documents.Flow.Model.Editing.RadFlowDocumentEditor = New Telerik.Windows.Documents.Flow.Model.Editing.RadFlowDocumentEditor(document) editor.InsertText("Hello world!") {{endregion}}
To export the document as a docx file, use [DocxFormatProvider]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%}). Using the below code will create a provider instance and save a document with it. The document will be exported in the bin folder of your current project.
{{region cs-radwordsprocessing-getting-started_1}} using (Stream output = new FileStream("output.docx", FileMode.OpenOrCreate)) { Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider docxProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider(); docxProvider.Export(document, output); } {{endregion}}
{{region cs-radwordsprocessing-getting-started_0}} Using output As Stream = New FileStream("output.docx", FileMode.OpenOrCreate) Dim docxProvider As Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider = New Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider() docxProvider.Export(document, output) End Using {{endregion}}
To export the document as a PDF file, use [PdfFormatProvider]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfformatprovider%}). Example 3 shows how to export the RadFlowDocument created in Examples 1 to a file.
{{region cs-radpdfprocessing-getting-started_2}} using (Stream output = File.OpenWrite("Output.pdf")) { Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider flowPdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider(); flowPdfProvider.Export(document, output); } {{endregion}}
{{region cs-radwordsprocessing-getting-started_0}} Using output As Stream = File.OpenWrite("Output.pdf") Dim flowPdfProvider As Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider = New Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider() flowPdfProvider.Export(document, output) End Using {{endregion}}
Run the project and you should see something like this:
Now that you have run your first project example with Telerik Document Processing Libraries, you may want to explore some additional features like clone, edit, merge, insert documents and more. Below you can find guidance on getting started with such tasks:
- [Explore Features]({%slug getting-started-explore-features%})
- [Further Information]({%slug getting-started-next-steps%})
- [System Requirements]({%slug installation-system-requirements%})
- [Installing on your computer]({%slug installation-installing-on-your-computer%})
- Document Processing SDK Examples
- [How to Obtain Telerik Document Processing Libraries for .NET Framework, .NET Standard, .NET Core, .NET 6/.NET 8/.NET 9]({%slug distribute-telerik-document-processing-libraries-net-versions%})