Skip to main content

Converting Excel Spreadsheets to PDFs

Version: 3.0

Converting Excel Spreadsheets to PDFs

DynamicPDF Converter supports Excel file conversion. The following example illustrates converting an Excel worksheet with advanced conversion options.

ExcelConverter​

Use the ExcelConverter class to convert Excel spreadsheets to PDF. The ExcelConverter class has properties, methods, and events for conversion.

info

The ExcelConverter class supports converting using a file path or using a byte array.

Events include ExcelConverter.Completed, ExcelConverter.DocumentParsing, ExcelConverter.ProgressChanged.

ExcelConversionOptions​

The ExcelConversionOptions class has the following properties in addition to its parent ConversionOptions properties:

ExcelConversionOptions options = new ExcelConversionOptions(false);
options.PageSize = ExcelPageSize.Executive;
options.Orientation = PageOrientation.Landscape;

ExcelConverter excelConverter = new ExcelConverter(@"sample-data.xlsx", options);
excelConverter.Convert(outputPdf);
Dim options As New ExcelConversionOptions(False)
options.PageSize = ExcelPageSize.Executive
options.Orientation = PageOrientation.Landscape
options.Author = "John Doe"
Dim excelConverter As New ExcelConverter("sample-data.xlsx", options)
excelConverter.Convert(outputPdf)

[ExcelFileConversion.cs](https://github.com/DynamicPDF/converter-dotnet-core/blob/master/converter-dotnet-core-console-cs/ExcelFileConversion.cs){#gitlink-id target=_blank}


[ExcelFileConversion.vb](https://github.com/DynamicPDF/converter-dotnet-core/blob/master/converter-dotnet-core-console-vb/ExcelFileConversion.vb){#gitlink-id target=_blank}