This is a brief tutorial to explain the process of how to convert Excel to SVG in Java. You may want to render a chart, graph, smart object, or any information to an SVG image for preserving the quality of the image at any dimension. Simply load an XLSX or XLS file and change Excel to SVG using Java with simple API calls in any operating system like macOS, Linux, or Windows.
Steps to Convert Excel to SVG in Java
- Add Aspose.Cells library from the Maven Repository in your application to convert Excel to SVG
- Instantiate a Workbook class instance to load input Excel file for creating SVG
- Create an instance of SvgSaveOptions class object and set parameters of output SVG
- Convert Excel workbook to Vector Graphics file by saving the workbook as SVG
In these simple steps, we load the input Excel file using the Workbook class object and next configure the SvgSaveOptions class object for setting properties for the required output SVG image. Specifically, different properties can be set like sheet index, merge areas, etc. to control the preferences of the output file. Finally, we convert Excel to vector graphics using Java by writing the output images on the disk.
Code to Change Excel to SVG using Java
You can notice that the code uses simple API calls to export Excel to SVG using Java. The whole code is based on a few steps where the source Excel file is loaded, then several properties of SVG image are specified using the SvgSaveOptions class object. These properties and settings are then passed over to the Save method for writing the created SVG image.
We have followed the procedure to change Excel to SVG in Java with simple steps and code. If you are inclined to explore Excel to XPS conversion, please consider checking the details mentioned in the article on how to convert Excel to XPS in Java.