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

Free Support Forum - aspose.com

Weird glyph layout null pointer

Hi!

I’m using the latest aspose-cells-2.4.1.jar version and I get this error while running tests:

java.lang.NullPointerException
at sun.font.GlyphLayout.layout(GlyphLayout.java:359)
at sun.font.ExtendedTextSourceLabel.createGV(ExtendedTextSourceLabel.java:308)
at sun.font.ExtendedTextSourceLabel.getGV(ExtendedTextSourceLabel.java:294)
at sun.font.ExtendedTextSourceLabel.createLogicalBounds(ExtendedTextSourceLabel.java:208)
at sun.font.ExtendedTextSourceLabel.getAdvance(ExtendedTextSourceLabel.java:117)
at java.awt.font.TextLine.init(TextLine.java:264)
at java.awt.font.TextLine.(TextLine.java:110)
at java.awt.font.TextLine.fastCreateTextLine(TextLine.java:952)
at java.awt.font.TextLayout.fastInit(TextLayout.java:585)
at java.awt.font.TextLayout.(TextLayout.java:374)
at sun.font.FontDesignMetrics.stringWidth(FontDesignMetrics.java:466)
at com.aspose.cells.b.E.b(Unknown Source)
at com.aspose.cells.b.b.a(Unknown Source)
at com.aspose.cells.b.b.a(Unknown Source)
at com.aspose.cells.b.k.a(Unknown Source)
at com.aspose.cells.b.k.g(Unknown Source)
at com.aspose.cells.b.k.a(Unknown Source)
at com.aspose.cells.b.k.j(Unknown Source)
at com.aspose.cells.b.k.a(Unknown Source)
at com.aspose.cells.b.b.a.a(Unknown Source)
at com.aspose.cells.Chart.toImage(Unknown Source)
at com.sonecta.export.powerpoint.PowerPoint.init(PowerPoint.java:196)


while running this code:

Chart chart = excel.getWorksheets().getSheet(i).getCharts().getChart(0);

ImageOptions imgOpts = new ImageOptions();
imgOpts.setImageFormat(com.aspose.cells.ImageFormat.PNG);
imgOpts.setFashion(1);

ByteArrayOutputStream pic = new ByteArrayOutputStream();

chart.toImage(pic, imgOpts);

NOTE: this does not happen with the version aspose.cells_2.3.1_20100716.jar.

Best regards,

Tuomas Hynninen
Sonecta Ltd

Hi,

Please paste your complete runnable code here to reproduce the issue on our end, we will check your issue soon.

Thank you.

Hi!

I can’t paste “complete runnable code” because it spans multiple source files. Do you have any idea what might be causing this, because I could paste code relating to that issue, e.g. if it is related to the way I generate the Excel files or what styles I use in them etc…

Best regards,

Tuomas Hynninen
Sonecta Ltd.

Hi Tuomas,

Please use the updated version aspose-cells-2.4.1.3-java.zip attached. The issue has been fixed.

Thanks,

Hi,

The bug still persists in version 2.4.1.3:

java.lang.NullPointerException
at sun.font.GlyphLayout.layout(GlyphLayout.java:359)
at sun.font.ExtendedTextSourceLabel.createGV(ExtendedTextSourceLabel.java:308)
at sun.font.ExtendedTextSourceLabel.getGV(ExtendedTextSourceLabel.java:294)
at sun.font.ExtendedTextSourceLabel.createLogicalBounds(ExtendedTextSourceLabel.java:208)
at sun.font.ExtendedTextSourceLabel.getAdvance(ExtendedTextSourceLabel.java:117)
at java.awt.font.TextLine.init(TextLine.java:264)
at java.awt.font.TextLine.(TextLine.java:110)
at java.awt.font.TextLine.fastCreateTextLine(TextLine.java:952)
at java.awt.font.TextLayout.fastInit(TextLayout.java:585)
at java.awt.font.TextLayout.(TextLayout.java:374)
at sun.font.FontDesignMetrics.stringWidth(FontDesignMetrics.java:466)
at com.aspose.cells.b.E.b(Unknown Source)
at com.aspose.cells.b.b.a(Unknown Source)
at com.aspose.cells.b.b.a(Unknown Source)
at com.aspose.cells.b.k.a(Unknown Source)
at com.aspose.cells.b.k.g(Unknown Source)
at com.aspose.cells.b.k.a(Unknown Source)
at com.aspose.cells.b.k.j(Unknown Source)
at com.aspose.cells.b.k.a(Unknown Source)
at com.aspose.cells.b.b.a.a(Unknown Source)
at com.aspose.cells.Chart.toImage(Unknown Source)
at com.sonecta.export.powerpoint.PowerPoint.init(PowerPoint.java:207)

Works OK in 2.3.1.

Best regards,

Tuomas Hynninen
Sonecta Ltd.

Hi,

Please try this new fix (attached). We have fixed another bug that may cause such an exception. If you still get this issue with the new fix, I think we need your help to trace the issue such as saving the Workbook to a file before converting charts to image and then send us the excel file if we can reproduce the issue from it on our end.

Thank you.

Hi!

The issue still persists in the 2.4.1.4 version.

I have attached two sample Excel files which were generated by different versions: 2.3.1 and 2.4.1.4.

Best regards,

Tuomas Hynninen
Sonecta Ltd.

Hi,

Thanks for providing us the sample files.

We need to investigate your issue. I have logged it into our issue tracking system with an id: CELLSJAVA-20653. We will look into it soon.

Thank you.

Hi,

Unfortunately, using the template files you sent we could not reproduce the issue for Chart2Image feature. Anyways, please try the new fix v2.4.1.6 (attached), we have made some possible enhancements for this issue.

Let us know if it works fine now.

Thank you.

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


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

Hi!

The issue was fixed in the aspose-cells-2.4.1.6.jar update.

Thanks!

Best regards,

Tuomas Hynninen
Sonecta Ltd

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan