New to Telerik Document Processing? Start a free 30-day trial
Convert Docx to PDF
Updated on Jun 5, 2026
Environment
| Product Version | Product | Author |
|---|---|---|
| 2021.3.909 | RadWordsProcessing | Dimitar Karamfilov |
Description
This article shows how to convert a DOCX file to PDF with the WordsProcessing library. For the required assembly references, see the WordsProcessing Getting Started article.
Solution
Import the file with the DocxFormatProvider and export it with the PdfFormatProvider:
csharp
public static void ConvertDocxToPdf(string path, string resultPath)
{
var docxProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();
var pdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
var docBytes = File.ReadAllBytes(path);
var document = docxProvider.Import(docBytes);
var resultBytes = pdfProvider.Export(document);
File.WriteAllBytes(resultPath, resultBytes);
}