The Syncfusion .NET Excel (XlsIO) library provides the easiest way of converting Excel files to PDF documents in C#/VB.NET with the PDF conformance level PDF/A1B using just a few lines of code. This process is fast, reliable, and supported in hosting environments such as AWS, Google Cloud App, and Microsoft Azure web services.
This example code shows how to convert an Excel document to a PDF file using the Syncfusion .NET Excel library with just a few lines of C# code.
// Initialize Excel engine and application
using ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Xlsx;
// Open an existing workbook
using FileStream excelStream = new FileStream("InputTemplate.xlsx", FileMode.Open, FileAccess.Read);
IWorkbook workbook = application.Workbooks.Open(excelStream);
// Initialize XlsIORenderer
XlsIORenderer renderer = new XlsIORenderer();
// Convert Excel document into PDF document
PdfDocument pdfDocument = renderer.ConvertToPDF(workbook);
// Save the PDF document into a stream
using FileStream outputStream = new FileStream("WorkbookToPDF.pdf", FileMode.Create, FileAccess.Write);
pdfDocument.Save(outputStream);
Discover how the Excel to PDF conversion features in the Syncfusion Excel library enable you to convert Excel files into high-quality PDF documents.
Layout options for Excel to PDF conversion provide flexible control over how the content is scaled in the output. Available layout options include Automatic, CustomScaling, FitAllColumnsOnOnePage, FitAllRowsOnOnePage, FitSheetOnOnePage, and NoScaling.
Custom paper size lets you specify the desired paper dimensions in inches for the output document. The default setting is empty, represented as {Width = 0.0, Height = 0.0}.
The PDF conformance level enables users to specify the PDF document’s compliance with standards, allowing options such as PDF/A-1b, PDF/A-2b, PDF/A-3b, or PDF/X-1a conformance.
Set image quality determines whether high-quality images are exported to the PDF document. When enabled, images retain their quality during the conversion process.
Embedding the required fonts ensures that the content is rendered accurately, regardless of font availability on the user’s system.
Font substitution allows users to select alternative fonts from their devices or upload custom fonts to replace specified fonts in the Excel document during the conversion to PDF.
Tagged PDF enables the conversion of Excel to PDF in compliance with the PDF/UA standard. This ensures that the resulting PDF is accessible, allowing users who depend on assistive technology to read and navigate the document’s content effectively.
Discover valuable resources from our blog and knowledge base articles to enhance your efficiency in converting Excel documents to PDF.
Knowledge base
Knowledge base
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
Product Updates
Technical Support
Yes. Syncfusion provides comprehensive support for converting Excel files to PDF format while preserving the charts and other shapes.
Yes. The Syncfusion Excel library provides default font fallback support for missing fonts. It also allows users to customize the fallback fonts themselves.
The Syncfusion Excel library supports the conversion of Xls (Excel97to2003), Xlsx, Xltm, Xlsm, CSV, and TSV format documents to PDF.
You can set the IsConvertBlankPage property to false to avoid converting blank pages in Excel to PDF conversion.
The Syncfusion Excel library supports portrait and landscape options to convert Excel files to PDF documents.
The Syncfusion .NET Excel library only supports printing Excel documents on Windows platforms. For the web, it can be accomplished by converting the Excel document to PDF format and then printing the resulting PDF document.
Yes. Syncfusion Excel library provides support for converting only a specified worksheet to a PDF.
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.