Convert Excel to PDF using .NET Excel (XlsIO) Library
27 Jul 20261 minute to read
The Syncfusion .NET Excel (XlsIO) library is a non-UI, native .NET class library that provides an easy way to convert Excel workbooks to PDF in C# and VB.NET with the PDF conformance level PDF/A1B using just a few lines of code. The conversion is fast and reliable, requires no Microsoft Office dependency, and is supported in hosting environments such as AWS, Google Cloud, and Microsoft Azure.
The library can be used in Windows Forms, WPF, UWP, ASP.NET Web Forms, ASP.NET MVC, ASP.NET Core, Xamarin, Blazor, WinUI, and .NET MAUI applications.
Prerequisites
Before converting an Excel workbook to PDF, make sure the following are in place:
- Install the required NuGet packages for your target platform.
- For .NET 8+ / .NET Core:
Syncfusion.XlsIO.Net.CoreandSyncfusion.Pdf.Net.Core - For Windows Forms:
Syncfusion.XlsIO.WinFormsandSyncfusion.Pdf.WinForms - For WPF:
Syncfusion.XlsIO.WpfandSyncfusion.Pdf.Wpf - For ASP.NET Core:
Syncfusion.XlsIO.AspNet.CoreandSyncfusion.Pdf.AspNet.Core
- For .NET 8+ / .NET Core:
- Register your Syncfusion license in the application. For more information, see Licensing overview.
- Add the required namespaces to your code file:
using Syncfusion.XlsIO;
using Syncfusion.Pdf;Supported Platforms
- Windows Forms, WPF, UWP, ASP.NET Web Forms, ASP.NET MVC, ASP.NET Core, Xamarin, Blazor, WinUI, and .NET MAUI
- Hosting environments: AWS, Google Cloud, and Microsoft Azure
- .NET versions: .NET Framework 4.6.1+, .NET Core 8, and later
Key Features
- Convert an Excel workbook to PDF.
- Convert an Excel workbook with a chart to PDF.
- Support for font substitution during Excel to PDF conversion.
- Generate PDF documents with PDF/A1B conformance for long-term archiving.
- Configure conversion behavior with converter settings such as
EmbedFonts,ImageQuality,TemplateDocument, andPageScalingOptions.
NOTE
You can also explore our .NET Excel Framework demo that shows how to create, modify, and convert Excel files from C# with 5 lines of code on different platforms.