New to Telerik Document Processing? Start a free 30-day trial
Convert Xlsx to PDF
Updated on Feb 19, 2026
| Product Version | Product | Author |
|---|---|---|
| 2021.2.511 | RadSpreadProcessing | Dimitar Karamfilov |
Description
This article demonstrates how you can convert a Xlsx file to a PDF with the SpreadProcessing library.
Solution
The solution is to import the file with the XlsxFormatProvider and export it with the PdfFormatProvider.
Convert Xlsx to PDF
csharp
public static void ConvertXlsxToPdf(string path, string resultPath)
{
var xlsxProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
var pdfProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider();
var docBytes = File.ReadAllBytes(path);
var workbook = xlsxProvider.Import(docBytes);
var resultBytes = pdfProvider.Export(workbook);
File.WriteAllBytes(resultPath, resultBytes);
}