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

Free Support Forum - aspose.com

Aspose HTML failed to convert HTML5 to image and throw internal ClassCastException

Hi support team,

We are going to purchase Aspose license to render HTML to images in our service. When we test on Aspose HTML with aspose-html-20.9.1-jdk16.jar, Converter.convertHTML() method fails with ClassCastException:

Exception in thread “main” java.lang.ClassCastException: com.aspose.html.internal.p201.z10 cannot be cast to com.aspose.html.internal.p204.z31
at com.aspose.html.internal.p202.z1.m1(Unknown Source)
at com.aspose.html.internal.p201.z12.m1(Unknown Source)
at com.aspose.html.internal.p201.z15.m1(Unknown Source)
at com.aspose.html.internal.p201.z12.m1(Unknown Source)
at com.aspose.html.internal.p201.z12.m1(Unknown Source)
at com.aspose.html.internal.p201.z15.m1(Unknown Source)
at com.aspose.html.internal.p201.z10.m1(Unknown Source)
at com.aspose.html.internal.p201.z10.m1(Unknown Source)
at com.aspose.html.internal.p201.z12.m1(Unknown Source)
at com.aspose.html.internal.p201.z15.m1(Unknown Source)
at com.aspose.html.internal.p201.z12.m1(Unknown Source)
at com.aspose.html.internal.p201.z12.m1(Unknown Source)
at com.aspose.html.internal.p201.z15.m1(Unknown Source)
at com.aspose.html.internal.p201.z10.m1(Unknown Source)
at com.aspose.html.internal.p201.z10.m1(Unknown Source)
at com.aspose.html.internal.p201.z27.m1(Unknown Source)
at com.aspose.html.internal.p201.z27.m1(Unknown Source)
at com.aspose.html.internal.p201.z27.m1(Unknown Source)
at com.aspose.html.internal.p201.z27.m1(Unknown Source)
at com.aspose.html.internal.p201.z59.m1(Unknown Source)
at com.aspose.html.internal.p201.z2.m1(Unknown Source)
at com.aspose.html.internal.p201.z59.m1(Unknown Source)
at com.aspose.html.internal.p201.z59.m3(Unknown Source)
at com.aspose.html.internal.p201.z2.m1(Unknown Source)
at com.aspose.html.internal.p201.z59.m1(Unknown Source)
at com.aspose.html.internal.p201.z62.m3420(Unknown Source)
at com.aspose.html.internal.p153.z5.m2(Unknown Source)
at com.aspose.html.internal.p172.z10.m2862(Unknown Source)
at com.aspose.html.internal.p165.z2.m2(Unknown Source)
at com.aspose.html.internal.p165.z2.m2(Unknown Source)
at com.aspose.html.internal.p165.z2.m1(Unknown Source)
at com.aspose.html.internal.p151.z3.m1(Unknown Source)
at com.aspose.html.internal.p152.z1.m1(Unknown Source)
at com.aspose.html.internal.p256.z1.m1(Unknown Source)
at com.aspose.html.internal.p160.z4.m1(Unknown Source)
at com.aspose.html.internal.p160.z2.m5(Unknown Source)
at com.aspose.html.collections.z3.m135(Unknown Source)
at com.aspose.html.collections.z3.hasNext(Unknown Source)
at com.aspose.html.internal.p256.z1.m1(Unknown Source)
at com.aspose.html.rendering.HtmlRenderer.render(Unknown Source)
at com.aspose.html.rendering.HtmlRenderer.render(Unknown Source)
at com.aspose.html.rendering.Renderer.render(Unknown Source)
at com.aspose.html.rendering.Renderer.render(Unknown Source)
at com.aspose.html.converters.z5.m1(Unknown Source)
at com.aspose.html.converters.z5.m1(Unknown Source)
at com.aspose.html.converters.z5.m1(Unknown Source)
at com.aspose.html.converters.Converter.convertHTML(Unknown Source)
at com.indeed.html2ImageTest.AsposeTest.main(AsposeTest.java:39)

The input HTML contains some page structure elements introduced by HTML5, such as , . Not sure if Aspose fully supports HTML5. (When Aspose is tested with some other simple HTML, it works perfectly)

Is it a known bug or limitation of Aspose?

@aaronyan

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input HTML file.
  • Please create a simple Java application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hi @tahir.manzoor,

Please see the attached input HTML and simple Java application, and let me know if you need more information.

The Aspose library version is aspose:aspose-html:jdk16:20.9.1

aspose_debugging.zip (4.3 KB)

@aaronyan

We have logged this problem in our issue tracking system as HTMLJAVA-1259. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@tahir.manzoor Do we have any update on HTMLJAVA-1259?

@aaronyan

Currently, your issue is pending for analysis and is in the queue. Once we complete the analysis of your issue, we will then be able to provide you an estimate.