Clip art image problem

Hi,


I am trying to get the clip art image from excel

Picture picture=pictures.get(0);

ImageOrPrintOptions io= new ImageOrPrintOptions();
io.setImageFormat(ImageFormat.getPng());
io.setQuality(100);
ByteArrayOutputStream out = new ByteArrayOutputStream();
picture.toImage(out,io);

when i try to save the picture toImage(…) then it throw the below exception.

java.lang.NullPointerException
at com.aspose.cells.tW.m(Unknown Source)
at com.aspose.cells.wr.a(Unknown Source)
at com.aspose.cells.wr.aj(Unknown Source)
at com.aspose.cells.A.t(Unknown Source)
at com.aspose.cells.A.p(Unknown Source)
at com.aspose.cells.wt.b(Unknown Source)
at com.aspose.cells.Shape.toImage(Unknown Source)

I want to know how to get the clip art image
Please help in this regards .



Hi Babar,


Thank you for using Aspose.Cells.

Please provide us your source Excel file, so that we can look into it and assist you further.

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Please download and try the latest version:

Aspose.Cells for Java 7.3.0
and let us know your feedback.

If the problem still occurs, then please provide us your source xls/xlsx file replicating this problem.

We will soon look into it and help you asap.

Hi,

Please fine the source file attachment.

Hi,

Thanks for your file.

I was able to replicate this problem using the latest version:

Aspose.Cells for Java 7.3.0



We have logged this issue in our database. We will look into it and fix the problem and update you asap.

This issue has been logged as CELLSJAVA-40257.

Below is a sample test code and the exception that it generates.

Java


String filePath = “F:\Shak-Data-RW\Downloads\Clipart(2007).xls”;


Workbook workbook = new Workbook(filePath);

Worksheet worksheet = workbook.getWorksheets().get(0);


Picture pic = worksheet.getPictures().get(0);


ImageOrPrintOptions opts = new ImageOrPrintOptions();

pic.toImage(filePath + “.out.jpg”, opts);

Exception:
Exception in thread “main” java.lang.NullPointerException
at com.aspose.cells.ug.m(Unknown Source)
at com.aspose.cells.wQ.a(Unknown Source)
at com.aspose.cells.wQ.aj(Unknown Source)
at com.aspose.cells.B.t(Unknown Source)
at com.aspose.cells.B.p(Unknown Source)
at com.aspose.cells.wS.a(Unknown Source)
at com.aspose.cells.Shape.toImage(Unknown Source)
at ClsAsposeTest.f1(ClsAsposeTest.java:50)
at ClsAsposeTest.main(ClsAsposeTest.java:25)

Hi,

Thanks for using Aspose.Cells for Java.

We have fixed this issue.
.
Please download and try this fix: Aspose.Cells for Java v7.3.0.3 and let us know your feedback.

The issues you have found earlier (filed as CELLSJAVA-40257) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.