Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active October 15, 2021 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/5048ca45afa67017c1271181930e213a to your computer and use it in GitHub Desktop.
Save aspose-com-gists/5048ca45afa67017c1271181930e213a to your computer and use it in GitHub Desktop.
Convert Excel XLSX or XLS to SVG in C#
// Load Excel file
var workbook = new Workbook("sourceFile.xlsx");
// Get reference of desired worksheet
var worksheet = workbook.Worksheets[0];
// Set options for output image
var options = new Aspose.Cells.Rendering.ImageOrPrintOptions()
{
OnePagePerSheet = true,
ImageType = Aspose.Cells.Drawing.ImageType.Svg
};
// Convert Excel worksheet to SVG
var renderer = new Aspose.Cells.Rendering.SheetRender(worksheet, options);
renderer.ToImage(0, "output.svg");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment