Convert Excel to PDF
DynamicPDF Converter can easily convert a Microsoft Excel file into a PDF document.
How to Convert Excel to PDF
The following steps and sample code illustrate converting an Excel file to a PDF document using DynamicPDF Converter.
Converting an Excel file to PDF file is as straightforward as a single static method call to the Convert method of the Converter class. This call only requires passing an excel file path and path to output the resultant PDF.
Use the advanced ExcelConversionOptions and ExcelConverter classes for more complex processing.
Steps to Convert Excel to a PDF (Convert
)
- Call the Converter class's static Convert method and specify the input excel file and output PDF file.
Sample Code - C#
Converter.Convert("DocumentA.xlsx", "MyOutput.pdf")
Steps to Convert Excel to a PDF (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("OfficeExcelFileConversion.pdf");
GitHub Project
Clone or view the example project at GitHub. This example on this page is in the ExcelFileConversion.cs file. Examples are provided for both C# and VB.NET.
Getting Started
Get started by installing the NuGet package or referring to the online documentation.
NuGet Package
DynamicPDF Converter is available on NuGet and is part of the ceTe.DynamicPDF.Converter.NET
package. The easiest way to install the DynamicPDF Converter package is by using the Visual Studio Package Manager. However, you can also download it directly from NuGet.
NuGet Package ID: ceTe.DynamicPDF.Converter.NET
DynamicPDF Core Suite Information
More information can be found at the DynamicPDF Converter webpage.