Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

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

$
0
0
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.<init>(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("<h1>test</h1>"); 
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.

Viewing all articles
Browse latest Browse all 3131