Chart to Image Quality not good

Hi,



Please see the attached file having a chart not being converted to proper quality while doing chart to image conversion using java cells library.

Result is also attached

Thanks,
Azeem

Hi,

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

We were able to replicate this issue using the latest version with your source file. The quality of the image is not good. We have logged this issue in our database. We will look into it and resolve 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-40547.

Can you please share any ETA for resolving this issue?

Hi,

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

We are afraid, there is no update for you at this moment. However, we have logged your comment in our database. Once, we will have some update for you, we will let you know asap.

Hi,

Please download and try the latest version: Aspose.Cells for Java v7.5.0.5

Please use this sample code before saving:

Java


book.getWorksheets().get(“Sheet5”).getCharts().get(0).refreshPivotData();


Thanks,

I will try this out and let you know,
I have an issue on my local machine Windows based, whenever i try to convert chart to image I get following exception, but on another machine which is Solaris , it works fine irrespective of the image quality.

Can u please let me know if i am missing something

Workbook book=new Workbook(“C:/works/testFiles/Pivot_table_chart.xls”);
ImageOrPrintOptions io= new ImageOrPrintOptions();
io.setImageFormat(ImageFormat.getPng());
io.setQuality(100);
Chart chart=book.getWorksheets().get(0).getCharts().get(0);
chart.refreshPivotData();
chart.toImage(new FileOutputStream(“C:/works/testFiles/Pivot_table_chart.png”),io);



Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.ExtendedTextSourceLabel.createCharinfo(Unknown Source)
at sun.font.ExtendedTextSourceLabel.getCharinfo(Unknown Source)
at sun.font.ExtendedTextSourceLabel.getLineBreakIndex(Unknown Source)
at java.awt.font.TextMeasurer.calcLineBreak(Unknown Source)
at java.awt.font.TextMeasurer.getLineBreakIndex(Unknown Source)
at com.aspose.cells.b.a.b.d.a.c.n(Unknown Source)
at com.aspose.cells.b.a.b.d.a.c.k(Unknown Source)
at com.aspose.cells.b.a.b.i.a(Unknown Source)
at com.aspose.cells.b.a.b.i.a(Unknown Source)
at com.aspose.cells.bbd.a(Unknown Source)
at com.aspose.cells.abf.b(Unknown Source)
at com.aspose.cells.abf.b(Unknown Source)
at com.aspose.cells.abf.a(Unknown Source)
at com.aspose.cells.et.a(Unknown Source)
at com.aspose.cells.et.b(Unknown Source)
at com.aspose.cells.gg.ao(Unknown Source)
at com.aspose.cells.ac.t(Unknown Source)
at com.aspose.cells.ac.p(Unknown Source)
at com.aspose.cells.gk.a(Unknown Source)
at com.aspose.cells.Chart.toImage(Unknown Source)
Hi,

[quote user="azeemyousaf"]Thanks,
I will try this out and let you know,
I have an issue on my local machine Windows based, whenever i try to convert chart to image I get following exception, but on another machine which is Solaris , it works fine irrespective of the image quality.

Can u please let me know if i am missing something

Workbook book=new Workbook("C:/works/testFiles/Pivot_table_chart.xls");
ImageOrPrintOptions io= new ImageOrPrintOptions();
io.setImageFormat(ImageFormat.getPng());
io.setQuality(100);
Chart chart=book.getWorksheets().get(0).getCharts().get(0);
chart.refreshPivotData();
chart.toImage(new FileOutputStream("C:/works/testFiles/Pivot_table_chart.png"),io);



Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.ExtendedTextSourceLabel.createCharinfo(Unknown Source)
at sun.font.ExtendedTextSourceLabel.getCharinfo(Unknown Source)
at sun.font.ExtendedTextSourceLabel.getLineBreakIndex(Unknown Source)
at java.awt.font.TextMeasurer.calcLineBreak(Unknown Source)
at java.awt.font.TextMeasurer.getLineBreakIndex(Unknown Source)
at com.aspose.cells.b.a.b.d.a.c.n(Unknown Source)
at com.aspose.cells.b.a.b.d.a.c.k(Unknown Source)
at com.aspose.cells.b.a.b.i.a(Unknown Source)
at com.aspose.cells.b.a.b.i.a(Unknown Source)
at com.aspose.cells.bbd.a(Unknown Source)
at com.aspose.cells.abf.b(Unknown Source)
at com.aspose.cells.abf.b(Unknown Source)
at com.aspose.cells.abf.a(Unknown Source)
at com.aspose.cells.et.a(Unknown Source)
at com.aspose.cells.et.b(Unknown Source)
at com.aspose.cells.gg.ao(Unknown Source)
at com.aspose.cells.ac.t(Unknown Source)
at com.aspose.cells.ac.p(Unknown Source)
at com.aspose.cells.gk.a(Unknown Source)
at com.aspose.cells.Chart.toImage(Unknown Source)
[/quote]

Could you attach your template Excel file here, we will check your issue soon.

Also kindly give us your environment details, e.g OS, (32bit/64bit), JDK version etc where you got the exception. I suspect the issue might be JDK version especially if you are using JDK version e.g 1.7.0_21 etc. If you are using JDK 1.6 or earlier version, this issue might not be occurring, could you confirm this on your end. We have already logged a ticket for JDK 1.7 version's issue into our database, we are already working on it. After confirmation, we may link your thread to the specified issue/ticket accordingly.

Thank you.

Ok, Know i got it, on Solaris, we are using JDK6 thats why it works fine there and on my local I am using JDK7.



Thanks,
And i got the issue fixed as per your above stated code with 7.5.0.5 version

Hi,


Thanks for the confirmation and good to know that JDK1.6 version works for your needs.

Also, as I mentioned in my previous post, we already logged a ticket with an id “CELLSJAVA-40558” for chart to image issue regarding JDK1.7 versions. Your thread is also linked to the issue into our database. Once we have any update on it, we will let you know here.

Thank you.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.