Free Support Forum - aspose.com

setFontName crash

Hi support,

Please note that the method setFontName() throws :
java.lang.NoClassDefFoundError: com.aspose.pdf.elements.BasicImage
at com.aspose.pdf.elements.dh.class$(Unknown Source)
at com.aspose.pdf.elements.dh.a(Unknown Source)
at com.aspose.pdf.elements.dh.if(Unknown Source)
at com.aspose.pdf.elements.ft.u(Unknown Source)
at com.aspose.pdf.elements.ft.a(Unknown Source)
at com.aspose.pdf.elements.dh.a(Unknown Source)
at com.aspose.pdf.elements.dh.a(Unknown Source)
at com.aspose.pdf.elements.bv.a(Unknown Source)
at com.aspose.pdf.elements.bv.a(Unknown Source)
at com.aspose.pdf.elements.Segment.u(Unknown Source)
at com.aspose.pdf.elements.Text.a(Unknown Source)
at com.aspose.pdf.elements.Section.a(Unknown Source)
at com.aspose.pdf.elements.Pdf.if(Unknown Source)
at com.aspose.pdf.elements.Pdf.a(Unknown Source)
at com.aspose.pdf.elements.Pdf.save(Unknown Source)


I’ve used this code:

Pdf pdf = new Pdf();
Section sec1 = pdf.getSections().add();

Text text1 = new Text(sec1,“Para1”);
text1.getTextInfo().setFontSize(13);
text1.getTextInfo().setFontName(“Arial”);

sec1.getParagraphs().add(text1);
pdf.save(new FileOutputStream(new File(“C:/Temp/FontCrash.pdf”)));

This occurs with the jar provided here Pdf not saved when handling hyperlinks

Please take a look,
Milan

Hello Milan,

I've tested the scenario and I'm able to notice that setFontName(...) is not working when using Aspose.Pdf for Java 2.4.3.0. For the sake of correction, I've logged it in our issue tracking system as PDFJAVA-10936. We'll look into this matter and will update you with the status of correction.

We apologize for your inconvenience.

Hi,

Can you please make an estimation about the time of this fix ?

Thank you,
Milan

Hello Milan,

The issue has been resolved in the hotfix shared in this post. Please try using it and in case you face any problem, please feel free to contact.