Convert Excel to PDF
Easily convert Microsoft Excel files to PDF documents using DynamicPDF Converter for .NET. The following C# examples show you how.
How to Convert Excel to PDF
The following steps and C# sample code illustrate converting an Excel file to a PDF document using DynamicPDF Converter for .NET.
Steps to Convert Excel to a PDF (using static Convert method)
- Add the Converter class's static
Convert
method and specify the input Excel file and output PDF file.
Sample Code - C#
Converter.Convert("DocumentA.xlsx", "output.pdf")
Steps to Convert Excel to a PDF (using ExcelConverter and ExcelConversionOptions)
- Create a
ExcelConversionOptions
object to set the options. - Create a
ExcelConverter
object by specifying the Excel file and the options. - Invoke the
Convert
method on theExcelConverter
and specify the PDF file name.
Sample Code - C#
ExcelConversionOptions options = new ExcelConversionOptions(false);
ExcelConverter excelConverter = new ExcelConverter("DocumentA.xlsx", options);
excelConverter.Convert("output.pdf");
GitHub Project
Examples are provided in C# and VB.NET. Clone or view the example project at GitHub.
- C# -ExcelFileConversion.cs
- VB.NET - ExcelFileConversion.vb
Getting Started
Get started easily by installing DynamicPDF Converter for .NET through NuGet or manually. Then, refer to the documentation for more information on using and purchasing.
NuGet Package
The easiest way to install DynamicPDF Converter for .NET is by obtaining the NuGet package using Visual Studio's Package Manager. You can also obtain the NuGet package by downloading it directly. Refer to the installation documentation for more information.
NuGet Package ID: ceTe.DynamicPDF.Converter.NET
More Information on Excel Conversion
- Simple Conversion
- Converting Excel Spreadsheets to PDFs
- Chapter 7, Converting Microsoft Excel, in the book DynamicPDF Converter for .NET by Example available on GitHub.
DynamicPDF Converter Information
DynamicPDF Converter for .NET allows any .NET developer to dynamically convert many common file formats to PDF documents in real-time. It supports converting over 50 file types to PDF, including HTML and MS Office formats. The software supports events, enabling developers to easily and accurately handle both successful and failed conversions. It is intuitive and seamlessly integrates with all our DynamicPDF products. With a Free Evaluation Edition to try, why not start using DynamicPDF Converter Today!