How to Convert Excel to SVG in C++

Excel files can contain numeric as well as visual information like graphs or charts. To display some information in graphic format within your application, you may want to convert Excel to SVG in C++. This article will explain how to change Excel to SVG in C++ with step-by-step details and sample code. You can load the input file in XLSX or XLS format.

Steps to Convert Excel to SVG in C++

  1. Configure your application by adding Aspose.Cells.Cpp using NuGet Package Manager tool
  2. Add reference of Aspose::Cells namespace to the project
  3. Use the Workbook class instance to load the input Excel file
  4. Set the format and image properties for output SVG file
  5. Save the output SVG image on the disk rendered from the Excel file

This step-by-step approach explains the simple process to convert Excel to vector graphic in C++ where the input Excel file is loaded and different properties of the output image are set. You can set the resolution properties as well as the rendering format of the image as per your requirements. In the last step, write the output SVG image to the disk for further processing or viewing.

Code to Convert Excel to SVG in C++

As per the code snippet above, you need to use the Factory::CreateIWorkbook method for loading the input Excel file. Then set several preferences for output SVG image by using the IImageOrPrintOptions class and proceed to save the generated file by specifying the file path and name. You can modify any value of the properties in this code to satisfy your output criteria.

This short tutorial has focused on how to change Excel to vector graphic using C++. Whereas, if you need to convert Excel chart to JPEG image, refer to the article on how to convert Excel Chart to JPEG in C++.

 English