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

Free Support Forum - aspose.com

HTML String to PDF: Class cannot be cast to java.lang.reflect.ParameterizedType

Hi,

I am trying to create a PDF from an HTML string as shown in the code below.
I had used the same code previously in a test project and it worked fine, unfortunately it didn't work this time. (nothing of my knowledge that I have changed from the test project environment. )

Please help me get this work again.

#error
java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
at aspose.pdf.internal.z589.m2(Unknown Source)
at aspose.pdf.internal.z589.m1(Unknown Source)
at aspose.pdf.internal.z560.(Unknown Source)
....
at aspose.pdf.internal.z303.m1(Unknown Source)
at aspose.pdf.xml.DocumentBase.m1(Unknown Source)
at aspose.pdf.internal.z277.m1(Unknown Source)
at aspose.pdf.Pdf.save(Unknown Source)
....

#code
Pdf pdf = new Pdf();
Section section = pdf.getSections().add();
Text text = new Text("

test

");
text.isHtmlTagSupported(true);
section.getParagraphs().add(text);
pdf.save("C:/testPDF/test.pdf");

#edit

I tested the above code with aspose-pdf 4.6.0 and it worked fine.
So, it seems it is not working anymore with aspose-pdf 9.3.1

Please help me resolve this.

Thank you,
Nikit.

Hi Nikit,


Thanks
for using our API’s.<o:p></o:p>

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWJAVA-34465. We will investigate this issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.

The issues you have found earlier (filed as PDFNEWJAVA-34465) have been fixed in Aspose.Pdf for Java 9.5.2.


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