NullPointer while PPTX Converting to PDF with JAVA on AIX

Hi,

I use the following Java Program on AIX:

InputStream _is = new FileInputStream(_inputFileName);
PresentationEx _presentation = new PresentationEx(_is);
com.aspose.slides.export.PdfOptions _pdfSaveOptions = new com.aspose.slides.export.PdfOptions();
_pdfSaveOptions.setCompliance(com.aspose.slides.export.PdfCompliance.PDF_15);
_pdfSaveOptions.setSaveMetafilesAsPng(false);
_pdfSaveOptions.setTextCompression(com.aspose.slides.export.PdfTextCompression.NONE); ByteArrayOutputStream _byteAOs = new ByteArrayOutputStream();
FileOutputStream _fos=null;
try {
_presentation.save(_byteAOs, com.aspose.slides.export.SaveFormat.PDF, _pdfSaveOptions);

I get the NullPointer Exception as in the attachment. The Presentation I also send to you as attachment.
Is it a bug or do I have a coding problem.

By the way, the same Program running on Windows 7 works fine.

Any help welcome.

best regards,

Igor

Hi Lgor,


I feel you have shared the same query in another forum thread as well and I have shared my response there as well. Please visit this thread link for your kind reference.

Many Thanks,

Hi,


thank you for your quick response. Sorry, but it’s another case. The source code I share with you does not use the loadExternalFonts and so there is another exception happening, please have a look to the attachment StackTrace of this case. I only used the same presentation as of the other case, because at the moment I’m not able at all to convert this presentation to pdf on AIX machine.

best regards,

Igor

Hi Lgor.


I am sorry for your inconvenience. Unfortunately, I have no AIX machine on my end to verify the issue. I have just shared our latest product release Aspose.Slides for Java 3.0.0 on our end. Please visit this link for downloading the latest release of Aspose.Slides for Java 3.0.0 on your end. If there is still an issue then please share your feedback and I will add an issue in our issue tracking system for this.

Many Thanks,

Hi


I downloaded Aspose.Slides for Java 3.0 and did following coding:

InputStream _is = new FileInputStream(_inputFileName);
PresentationEx _presentation = new PresentationEx(_is);
PdfOptions _pdfSaveOptions = new PdfOptions();
_pdfSaveOptions.setWarningCallback(warningPresentationCallback);
_pdfSaveOptions.setCompliance(com.aspose.slides.PdfCompliance.Pdf15); ByteArrayOutputStream _byteAOs = new ByteArrayOutputStream();
FileOutputStream _fos=null;
_presentation.save(_byteAOs, com.aspose.slides.SaveFormat.Pdf, _pdfSaveOptions);

I get the following error on AIX (on windows works fine):
[java] Exception: java.lang.AssertionError : Cannot read a name from the name table in a font.
[java] Trace:
[java] java.lang.AssertionError: Cannot read a name from the name table in a font.
[java] at com.aspose.slides.b.a.b.a.do(Unknown Source)
[java] at com.aspose.slides.a.n.do(Unknown Source)
[java] at com.aspose.slides.a.n.do(Unknown Source)
[java] at com.aspose.slides.a.n.do(Unknown Source)
[java] at com.aspose.slides.a.l.C.if(Unknown Source)
[java] at com.aspose.slides.a.l.C.this(Unknown Source)
[java] at com.aspose.slides.a.l.C.do(Unknown Source)
[java] at com.aspose.slides.a.l.k.do(Unknown Source)
[java] at com.aspose.slides.a.l.k.(Unknown Source)
[java] at com.aspose.slides.a.l.h.case(Unknown Source)
[java] at com.aspose.slides.a.l.h.try(Unknown Source)
[java] at com.aspose.slides.a.l.h.do(Unknown Source)
[java] at com.aspose.slides.a.l.j.do(Unknown Source)
[java] at com.aspose.slides.a.l.j.do(Unknown Source)
[java] at com.aspose.slides.a.l.j.do(Unknown Source)
[java] at com.aspose.slides.lU.(Unknown Source)
[java] at com.aspose.slides.GU.int(Unknown Source)
[java] at com.aspose.slides.GU.final(Unknown Source)
[java] at com.aspose.slides.co.do(Unknown Source)
[java] at com.aspose.slides.Gm.do(Unknown Source)
[java] at com.aspose.slides.Gm.do(Unknown Source)
[java] at com.aspose.slides.Gm.do(Unknown Source)
[java] at com.aspose.slides.Gm.(Unknown Source)
[java] at com.aspose.slides.TextFrameEx.do(Unknown Source)
[java] at com.aspose.slides.AutoShapeEx.do(Unknown Source)
[java] at com.aspose.slides.AutoShapeEx.do(Unknown Source)
[java] at com.aspose.slides.GroupShapeEx.do(Unknown Source)
[java] at com.aspose.slides.SlideEx.do(Unknown Source)
[java] at com.aspose.slides.SlideEx.do(Unknown Source)
[java] at com.aspose.slides.xV.if(Unknown Source)
[java] at com.aspose.slides.PresentationEx.do(Unknown Source)
[java] at com.aspose.slides.PresentationEx.save(Unknown Source)

Any Idea?

best regards,

Igor

Hi Lgor,


Thanks for sharing your feedback. I have created an issue with ID SLIDESJAVA-33569 in our issue tracking system to further investigate and resolve the issue. I will be really thankful if you please share the JDK version that you are using on your end along with fonts used in your presentation for expedite investigation of the issue. I appreciate your cooperation in advance for this.

We are sorry for your inconvenience,

Hi Lgor,


I have also observed from your exception message that issue is related with fonts. Can you please also try presentation without embedded fonts (Aspose.Slides doesn’t support embedded fonts) and with some widespread fonts (Arial, Courier New)? Please share your feedback with us by working over the presentation with specified fonts.

Many Thanks,

Hi,


thank you for your help. We use the following JDK on AIX:

java version "1.6.0"
Java™ SE Runtime Environment (build pap6460sr9fp1-20110208_03(SR9 FP1))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc64-64 jvmap6460sr9-20110203_74623 (JIT enabled, AOT enabled)
J9VM - 20110203_074623
JIT - r9_20101028_17488ifx3
GC - 20101027_AA)
JCL - 20110203_01


Hope this helps you.

best regards,

Igor

Hi,


I used a new presentation (look at the attachment), very basic with Arial Font. I still have the same problem. How I can find out what the error message “Cannot read a name from the name table in a font.” exactly means?


best regards,

Igor Berchtold


Hi Igor Berchtold,


Thanks for your feedback. I have updated the issue status and will be able to share the further updates with you as soon as it ill be investigated by our development team.

Many Thanks,

Propably the same issue with slides version 3.0.0 on Linux using this kind of code (adding a slide to a different slide, Format PPTX). This did not happen with lates 2.9.x version:


PresentationEx srcPres = new PresentationEx(pptxfile);
int max = srcPres.getSlides().size();
for (int i = 0; i < max; i++) {
try {
PresentationEx destPres = new PresentationEx();
SlidesEx slds = destPres.getSlides();
SlideEx srcSlide = srcPres.getSlides().get_Item(i);
slds.addClone(srcSlide);


Results in this error:
java.lang.AssertionError: Cannot read a name from the name table in a font.
at com.aspose.slides.b.a.b.a.do(Unknown Source)
at com.aspose.slides.a.n.do(Unknown Source)
at com.aspose.slides.a.n.do(Unknown Source)
at com.aspose.slides.a.n.do(Unknown Source)
at com.aspose.slides.a.l.C.if(Unknown Source)
at com.aspose.slides.a.l.C.try(Unknown Source)
at com.aspose.slides.a.l.C.do(Unknown Source)
at com.aspose.slides.a.l.k.do(Unknown Source)
at com.aspose.slides.a.l.k.(Unknown Source)
at com.aspose.slides.a.l.h.case(Unknown Source)
at com.aspose.slides.a.l.h.try(Unknown Source)
at com.aspose.slides.a.l.h.do(Unknown Source)
at com.aspose.slides.a.l.j.do(Unknown Source)
at com.aspose.slides.a.l.j.do(Unknown Source)
at com.aspose.slides.a.l.j.do(Unknown Source)
at com.aspose.slides.lU.(Unknown Source)
at com.aspose.slides.GU.int(Unknown Source)
at com.aspose.slides.GU.final(Unknown Source)
at com.aspose.slides.co.do(Unknown Source)
at com.aspose.slides.Gm.do(Unknown Source)
at com.aspose.slides.Gm.do(Unknown Source)
at com.aspose.slides.Gm.do(Unknown Source)
at com.aspose.slides.Gm.(Unknown Source)
at com.aspose.slides.TextFrameEx.do(Unknown Source)
at com.aspose.slides.AutoShapeEx.do(Unknown Source)
at com.aspose.slides.AutoShapeEx.case(Unknown Source)
at com.aspose.slides.AutoShapeEx.do(Unknown Source)
at com.aspose.slides.ShapesEx.do(Unknown Source)
at com.aspose.slides.GroupShapeEx.do(Unknown Source)
at com.aspose.slides.BaseSlideEx.do(Unknown Source)
at com.aspose.slides.MasterSlideEx.do(Unknown Source)
at com.aspose.slides.PresentationEx.do(Unknown Source)
at com.aspose.slides.MasterSlidesEx.if(Unknown Source)
at com.aspose.slides.MasterSlidesEx.addClone(Unknown Source)
at com.aspose.slides.SlidesEx.if(Unknown Source)
at com.aspose.slides.SlidesEx.addClone(Unknown Source)

Testcase with aspose.slides.3.0.0 for java on linux (ubuntu12)

-----

package com.aspose.testcases.slides;

import java.io.InputStream;

import com.aspose.slides.*;


public class SplitPresentation {
public static void main(String[] args) {

InputStream inputStream = SplitPresentation.class
.getResourceAsStream("/META-INF/test1.pptx");

PresentationEx srcPres = new PresentationEx(inputStream);
int max = srcPres.getSlides().size();
for (int i = 0; i < max; i++) {
PresentationEx destPres = new PresentationEx();
SlideEx srcSlide = srcPres.getSlides().get_Item(i);
destPres.getSlides().addClone(srcSlide);
}

}
}


Exception in thread "main" java.lang.AssertionError: Cannot read a name from the name table in a font.
at com.aspose.slides.b.a.b.a.do(Unknown Source)
at com.aspose.slides.a.n.do(Unknown Source)
at com.aspose.slides.a.n.do(Unknown Source)
at com.aspose.slides.a.n.do(Unknown Source)
at com.aspose.slides.a.l.C.if(Unknown Source)
at com.aspose.slides.a.l.C.try(Unknown Source)
at com.aspose.slides.a.l.C.do(Unknown Source)
at com.aspose.slides.a.l.k.do(Unknown Source)
at com.aspose.slides.a.l.k.(Unknown Source)
at com.aspose.slides.a.l.h.case(Unknown Source)
at com.aspose.slides.a.l.h.try(Unknown Source)
at com.aspose.slides.a.l.h.do(Unknown Source)
at com.aspose.slides.a.l.j.do(Unknown Source)
at com.aspose.slides.a.l.j.do(Unknown Source)
at com.aspose.slides.a.l.j.do(Unknown Source)
at com.aspose.slides.lU.(Unknown Source)
at com.aspose.slides.GU.int(Unknown Source)
at com.aspose.slides.GU.final(Unknown Source)
at com.aspose.slides.co.do(Unknown Source)
at com.aspose.slides.Gm.do(Unknown Source)
at com.aspose.slides.Gm.do(Unknown Source)
at com.aspose.slides.Gm.do(Unknown Source)
at com.aspose.slides.Gm.(Unknown Source)
at com.aspose.slides.TextFrameEx.do(Unknown Source)
at com.aspose.slides.AutoShapeEx.do(Unknown Source)
at com.aspose.slides.AutoShapeEx.case(Unknown Source)
at com.aspose.slides.AutoShapeEx.do(Unknown Source)
at com.aspose.slides.ShapesEx.do(Unknown Source)
at com.aspose.slides.GroupShapeEx.do(Unknown Source)
at com.aspose.slides.BaseSlideEx.do(Unknown Source)
at com.aspose.slides.MasterSlideEx.do(Unknown Source)
at com.aspose.slides.PresentationEx.do(Unknown Source)
at com.aspose.slides.MasterSlidesEx.if(Unknown Source)
at com.aspose.slides.MasterSlidesEx.addClone(Unknown Source)
at com.aspose.slides.SlidesEx.if(Unknown Source)
at com.aspose.slides.SlidesEx.addClone(Unknown Source)
at com.aspose.testcases.slides.SplitPresentation.main(SplitPresentation.java:18)

Hi Lothar,


I have observed the issue shared by you. Can you please share the source presentation with us along with information about JDK and Linux distribution used on your end. I will try to reproduce the issue on my end to help you further.

Many Thanks,

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


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