Free Support Forum - aspose.com

Aspose.HTML转PDF/图片时异常

归档.zip (1.2 MB)

#版本

Aspose.HTML-19.9 for java

异常信息:

java.lang.ClassCastException: com.aspose.html.internal.p193.z10 cannot be cast to com.aspose.html.internal.p196.z31
at com.aspose.html.internal.p194.z1.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z15.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z15.m1(Unknown Source)
at com.aspose.html.internal.p193.z10.m1(Unknown Source)
at com.aspose.html.internal.p193.z10.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z15.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z15.m1(Unknown Source)
at com.aspose.html.internal.p193.z10.m1(Unknown Source)
at com.aspose.html.internal.p193.z10.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z15.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z15.m1(Unknown Source)
at com.aspose.html.internal.p193.z10.m1(Unknown Source)
at com.aspose.html.internal.p193.z10.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z15.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z15.m1(Unknown Source)
at com.aspose.html.internal.p193.z10.m1(Unknown Source)
at com.aspose.html.internal.p193.z10.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z15.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z12.m1(Unknown Source)
at com.aspose.html.internal.p193.z15.m1(Unknown Source)
at com.aspose.html.internal.p193.z10.m1(Unknown Source)
at com.aspose.html.internal.p193.z10.m1(Unknown Source)
at com.aspose.html.internal.p193.z27.m1(Unknown Source)
at com.aspose.html.internal.p193.z27.m1(Unknown Source)
at com.aspose.html.internal.p193.z27.m1(Unknown Source)
at com.aspose.html.internal.p193.z27.m1(Unknown Source)
at com.aspose.html.internal.p193.z59.m1(Unknown Source)
at com.aspose.html.internal.p193.z2.m1(Unknown Source)
at com.aspose.html.internal.p193.z59.m1(Unknown Source)
at com.aspose.html.internal.p193.z59.m3(Unknown Source)
at com.aspose.html.internal.p193.z2.m1(Unknown Source)
at com.aspose.html.internal.p193.z59.m1(Unknown Source)
at com.aspose.html.internal.p193.z62.m3128(Unknown Source)
at com.aspose.html.internal.p145.z5.m2(Unknown Source)
at com.aspose.html.internal.p164.z10.m2579(Unknown Source)
at com.aspose.html.internal.p157.z2.m2(Unknown Source)
at com.aspose.html.internal.p157.z2.m2(Unknown Source)
at com.aspose.html.internal.p157.z2.m1(Unknown Source)
at com.aspose.html.internal.p143.z3.m1(Unknown Source)
at com.aspose.html.internal.p144.z1.m1(Unknown Source)
at com.aspose.html.internal.p248.z1.m1(Unknown Source)
at com.aspose.html.internal.p152.z4.m1(Unknown Source)
at com.aspose.html.internal.p152.z2.m5(Unknown Source)
at com.aspose.html.collections.z2.m73(Unknown Source)
at com.aspose.html.collections.z2.hasNext(Unknown Source)
at com.aspose.html.internal.p248.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)

示例代码:

HTMLDocument document = new HTMLDocument(input);
HtmlRenderer renderer = new HtmlRenderer();
PdfRenderingOptions pdfRenderingOptions = new PdfRenderingOptions();
pdfDevice = new PdfDevice(pdfRenderingOptions,output);
renderer.render(pdfDevice, document);

@modongning,

Thanks for contacting support.

We have tested this scenario in our environment and have been able to observe the issue that you have mentioned. We have logged issue with ID HTMLJAVA-358 in our issue tracking system. We will share with you as soon as logged issue is fixed.