The Syncfusion .NET Excel (XlsIO) library makes it easy to convert Excel files to images in C#. With this library, you can effortlessly export and save worksheet content in PNG, JPG, and BMP image formats. This feature proves valuable in various scenarios where you need to share or display the worksheet content beyond Microsoft Excel, such as in presentations, websites, and documents.
This example code shows how to convert an Excel document to an image 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 inputStream = new FileStream("InputTemplate.xlsx", FileMode.Open, FileAccess.Read);
IWorkbook workbook = application.Workbooks.Open(inputStream );
IWorksheet sheet = workbook.Worksheets[0];
// Initialize the XlsIO renderer
application.XlsIORenderer = new XlsIORenderer();
// Save the image
using FileStream outputStream = new FileStream("Image.png", FileMode.Create, FileAccess.Write);
sheet.ConvertToImage(sheet.UsedRange, outputStream);
Discover how Excel-to-image conversion in the Syncfusion Excel library allows users to efficiently export worksheet content as images for seamless sharing and use in presentations or reports.
Render the full content of a worksheet as an image, making it easy to share or use in reports.
Export a designated range of cells from a worksheet as an image, focusing on specific content.
Ensure that all conditional formatting rules are preserved when converting a worksheet to an image.
Accurately export a worksheet containing a pivot table as an image, retaining data summaries.
Preserve rich text, text boxes, and Unicode characters when rendering a worksheet as an image.
Discover valuable resources from our documentation and knowledge base articles to enhance your efficiency in converting Excel to images.
Documentation
Documentation
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
Product Updates
Technical Support
You can set the image quality to normal mode or best mode while converting the Excel document to images.
You can select the cell range which includes shapes to perform the Excel to Image conversion. It will convert shapes to images using the Syncfusion Excel library.
Yes. The Syncfusion Excel library supports cell rich text formatting and will be included in the converted images.
The Syncfusion Excel library supports 1048576 rows and 16384 columns.
Yes. You can provide the conversion range to the maximum number of rows and columns to convert the entire worksheet to an image using the Syncfusion Excel library.
Yes. The Syncfusion Excel library supports table and pivot table styles in Excel to Image conversion.
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.