Excel files are widely used to keep and organize small as well as large sized data. Moreover, you can perform various operations on the data stored in Excel worksheets. In certain cases, you may need to convert the Excel worksheets to other formats, for example to embed their content within the web applications. For such cases, this article covers how to convert Excel XLSX or XLS files to SVG format using C#.
C# Excel to SVG Converter
In order to convert Excel XLSX or XLS files to SVG, we will use Aspose.Cells for .NET. It is a powerful API for creating, modifying, and converting spreadsheet files from within .NET applications. You can either download the API or install it using NuGet.
PM> Install-Package Aspose.Cells
Convert Excel XLSX or XLS to SVG
The following are the steps to convert an Excel XLSX or XLS file to SVG using C#.
- Load Excel file using Workbook class.
- Select the desired worksheet or loop through all the worksheets in Workbook.Worksheets collection.
- Create an object of ImageOrPrintOptions class and set rendering options.
- Create an object of SheetRenderer class for the worksheet.
- Convert Excel to SVG using SheetRenderer.ToImage(int32, string) method.
The following code sample shows how to convert an Excel XLSX file to SVG.
Get a Free License
Get a temporary license and use Aspose.Cells for .NET without evaluation limitations.
In this article, you have learned how to convert Excel XLSX or XLS files to SVG using C#. You can perform this conversion to embed the content of the Excel worksheets into your applications. Besides, you can also explore other features of Aspose.Cells for .NET using the documentation. Also, you can ask your questions via our forum.