Free Support Forum - aspose.com

PDF generation via XML fails

Hello:

This could very well be a Aspose.Cells problem but the immediate symptom is an exception:

com.aspose.pdf.exception.AsposeBaseException: null
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)
at com.blox.workflow.TestExcelGenTask.testCreateInvoice(TestExcelGenTask.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


I have attached the XML used to bind and the code does following:
Pdf pdf = Pdf.bindXML(new FileInputStream(“invoice.asp.xml”));
pdf.save(new FileOutputStream(new File(“invoice.pdf”)));

This xml was generated from Aspose.Cells. If you find issues in the xml structure and/or contents, would you be able to help me log an issue against Aspose.Cells.

Regards,
Parag

Hello Parag,

Thanks for considering Aspose.

I’ve tested the scenario with Aspose.Pdf for Java 2.4.3 and I’m unable to notice the problem. The resultant PDF is being generated without any issue.

Can you please try using the attached version and see if it can resolve your problem or not. For your reference, I’ve also attached the resultant PDF document. In case you still face any problem, please share the resource Excel worksheet so that we can test the scenario at our end.

We apologize for your inconvenience.

Thanks a bunch for the new version. It fixes the issue. I was working with Aspose.Pdf for Java 2.4. Is the 2.4.3 already released? I downloaded the Aspose.Total for Java this morning and didn’t get 2.4.3 in it.

Appreciate your quick response.
Regards,
Parag

Hello Parag,

Thanks for considering Aspose.

The version of Aspose.Pdf for Java that I’ve shared is the latest hotfix, recently introduced. Whereas Aspose.Total for Java contains the old stable release for Aspose.Pdf for Java.

Please try using the latest hotfix shared earlier and in case you face any issue, please feel free to contact.