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

Free Support Forum - aspose.com

Application crash when generating PDF using Aspose PDF 2.5.0

Hi,

I am in the process of evaluating/migrating to 2.5.0 of Aspose PDF and am having a problem with a simple PDF generation. Using the introductory sample application: ------------------------------------- //Create pdf document

Pdf pdf1 = new Pdf();
//Add a section into the pdf document
Section sec1 = pdf.getSections().add();
//Add a text paragraph into the section
sec1.getParagraphs().add(new Text("Hello World"));
//Save the document
pdf1.save("HelloWorld.pdf");

I get the following exception:

java.lang.NullPointerException at aspose.pdf.c.p.do(Unknown Source) at aspose.pdf.c.aa.if(Unknown Source) at aspose.pdf.e.m.a(Unknown Source) at aspose.pdf.e.bm.a(Unknown Source) at aspose.pdf.e.a1.a(Unknown Source) at aspose.pdf.e.bf.a(Unknown Source) at aspose.pdf.e.ap.a(Unknown Source) at aspose.pdf.Pdf.save(Unknown Source) at TestAspose.test(TestAspose.java:28) at TestAspose.main(TestAspose.java:39)

I have run this on both java SE 1.5.0_10 and 1.6 Is there a change in the API that I should be following.

regards,
srinivas


This message was posted using Email2Forum by codewarior. (attachment)

Hello srinivas,

Thanks for your interest in our products.

I've tested the scenario using Aspose.Pdf for Java 2.5.0 and I'm unable to notice any problem. I've been able to generate the PDF using the same code snippet that you've shared. The file is also in attachment, please take a look.

Can you please share some more details regarding your working environment.

We apologize for your inconvenience.