We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save workbook to SVG error

Workbook wb = new Workbook("c:/aspose/BookPer.xlsx");
SvgSaveOptions o = new SvgSaveOptions();
wb.save("c:/aspose/BookPer.svg", o);


But the result file is a TIFF image file, but not a valid SVG file

Hi,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue. The workbook is not saved in SVG format instead it is saved as Tiff image.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSJAVA-41152 - Save workbook to SVG error

Hi,


Please try our latest version/fix: Aspose.Cells for Java v8.3.1.5

If you want to save to SVG file format, please use SheetRender.toImage API. We don’t
support to save the whole workbook to a SVG file format at the moment.<o:p></o:p>

e.g

Sample code:


Workbook wb = new Workbook(srcFile);

ImageOrPrintOptions options = new ImageOrPrintOptions();

options.setSaveFormat(SaveFormat.SVG);

for(int i = 0; i < wb.getWorksheets().getCount(); i++)

{

Worksheet worksheet = wb.getWorksheets().get(i);

SheetRender sheetRender = new SheetRender(worksheet, options);

for(int j = 0; j < sheetRender.getPageCount(); j ++)

{

sheetRender.toImage(j, outFilePath + "_" + worksheet.getName() + "_" + j + ".svg");

}

}



Thank you.