Free Support Forum - aspose.com

Image Removed when copying a workbook using Java

Hello

I’m using Aspose.Cells for Java and when I copy a workbook that contains an image the image isn’t in the copied file. This is the code I use:
FileInputStream is = new FileInputStream(“fileName”);
Workbook old = new Workbook();
old.open(is);
Workbook newBook = new Workbook();
newBook.copy(old);
newBook.save(“copiedFileName”,FileFormatType.EXCEL2003);

//The above doesn’t work, the image isnt in the coppied file
//If i use the below code though the image is in the saved file.

FileInputStream is = new FileInputStream(“fileName”);
Workbook old = new Workbook();
old.open(is);
old.save(“copiedFileName”,FileFormatType.EXCEL2003);

I’m using the JDK 1.4 Aspose.Cells for Java V1.9.4 Hot Fix version of the jar file. And attached a version of the excel file I’m testing with.

Any help would be really appreciated.
Thanks
David

Hi David,

Thanks for poinint it out.

We will figure it out and support your desired functionality (copying images in the workbooks) soon.

Thank you.

Hi David,

Kindly try the attached version (1.9.4.8). In this version, Aspose.Cells now supports to read all the drawing objects and shapes except for some chart related shapes.

Thank you.

Thank you Amjad,

Thank you for getting back to me so quiclky.

I’m still seeing a problem with the new jar. Its working ok on the test file I sent before but I’m seeing a red X inplace of the picture when I try it on the excel I’ve attached.

Thanks
Dave

Hi Dave,

Thanks for the template file,

We have fixed the issue and will post your the fix shortly.

Thank you.

Hi Dave,

Kindly try the attached new fix. We have tested with your template file and it works fine, the image gets copied fine now.

Thank you.

Fantastic! The jar works great. Thanks again for your very quick response.

David