Image Converter
The Aspose.Cells Image Converter for .NET Plugin enables developers to transform Excel content into image formats such as PNG, JPEG, BMP, and more. Whether you’re converting entire workbooks, individual worksheets, cell ranges, or embedded charts, this plugin ensures your spreadsheet data is rendered with pixel-perfect accuracy.
Latest Articles
Aspose.Cells Image Converter Key Features
Convert Worksheets, Charts, and Ranges to Images
Render entire worksheets, specific ranges, or embedded charts into high-quality image files suitable for reports, documentation, and online previews.Customizable Rendering Settings
UseImageOrPrintOptions
to control resolution, page scaling, gridline visibility, and more. Fine-tune each conversion to meet your visual and layout requirements.Support for All Major Excel Formats
Supports XLS, XLSX, XLSM, XLSB, XLTX, XLTM, CSV, TSV, HTML, ODS, and other spreadsheet file formats for image export.Chart and Pivot Table Rendering
Convert embedded Excel charts and pivot tables directly into standalone images for data visualization or web use.Optimized Sheet and Workbook Rendering
UseSheetRender
orWorkbookRender
classes to render individual sheets or full workbooks across multiple pages.Seamless Integration with .NET Projects
Works out-of-the-box with any .NET Framework or .NET Core application for batch or on-demand image generation.
Getting Started with Aspose.Cells Image Converter for .NET
To begin converting Excel files to image formats, follow these steps:
1. Install Aspose.Cells for .NET
Use NuGet to add Aspose.Cells to your project:
dotnet add package Aspose.Cells
2. Load the Excel Workbook
Workbook workbook = new Workbook("Book1.xlsx");
3. Render a Worksheet to PNG
Worksheet sheet = workbook.Worksheets[0];
ImageOrPrintOptions options = new ImageOrPrintOptions
{
ImageType = ImageType.Png,
OnePagePerSheet = true,
Resolution = 200
};
SheetRender renderer = new SheetRender(sheet, options);
for (int i = 0; i < renderer.PageCount; i++)
{
renderer.ToImage(i, $"sheet_page_{i + 1}.png");
}
4. Render an Entire Workbook
ImageOrPrintOptions options = new ImageOrPrintOptions { ImageType = ImageType.Jpeg };
WorkbookRender render = new WorkbookRender(workbook, options);
render.ToImage(0, "workbook_render.jpg");
Most Popular Scenarios
Convert Excel Charts to Images
Workbook wb = new Workbook("ChartSheet.xlsx");
Worksheet chartSheet = wb.Worksheets[0];
ImageOrPrintOptions chartOptions = new ImageOrPrintOptions { ImageType = ImageType.Png };
SheetRender chartRender = new SheetRender(chartSheet, chartOptions);
chartRender.ToImage(0, "chart.png");
Convert a Cell Range to an Image
Workbook wb = new Workbook("Data.xlsx");
Range range = wb.Worksheets[0].Cells.CreateRange("A1:C10");
ImageOrPrintOptions rangeOptions = new ImageOrPrintOptions { ImageType = ImageType.Png };
SheetRender rangeRender = new SheetRender(wb.Worksheets[0], rangeOptions);
rangeRender.ToImage(0, "range_output.png");
Render a Pivot Table as Image
Workbook wb = new Workbook("PivotData.xlsx");
ImageOrPrintOptions options = new ImageOrPrintOptions { ImageType = ImageType.Png };
SheetRender pivotRender = new SheetRender(wb.Worksheets[0], options);
pivotRender.ToImage(0, "pivot_table.png");
Best Practices for Image Conversion
- Always auto-fit columns before rendering to ensure full visibility.
- Increase resolution for high-DPI output in web and print usage.
- Use white background color for cleaner exports (
options.Transparent = false
). - Validate content visibility for hidden rows, merged cells, or comments.
Common Issues and Resolutions
Error: File not found
Solution: Confirm that the source Excel file path is valid and accessible.
Error: Unsupported file format
Solution: Ensure the input file type is supported (e.g., avoid legacy macros without compatibility mode).
Output Image Cropped or Cut Off
Solution: Use OnePagePerSheet = true
or enable AllColumnsInOnePagePerSheet
for wider sheets.