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.
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)