Aspose HTML for java conversion HTML to PDF ends with exception

Hello,
I perform conversion from HTML to PDF with following Java code:

      final String myDocument = "./testcases/Functional programming - HaskellWiki.html";  
      final String myDocumentOut = "./testcases/out/Functional programming - HaskellWiki.pdf"; 
      final com.aspose.html.saving.PdfSaveOptions soptPdf = new com.aspose.html.saving.PdfSaveOptions();
      com.aspose.html.converters.Converter.convertHTML(myDocument, soptPdf, myDocumentOut);

most of file works fine, but with attached file
Functional programming - HaskellWiki.zip (12.1 KB)

I got following exception:

Exception in thread "main" class com.aspose.html.utils.ms.System.ArgumentException: element already exists
com.aspose.html.utils.ms.System.Collections.Generic.SortedList.a(Unknown Source)
com.aspose.html.utils.ms.System.Collections.Generic.SortedList.addItem(Unknown Source)
com.aspose.html.utils.Ez.ek(Unknown Source)
com.aspose.html.utils.Ez.hn(Unknown Source)
com.aspose.html.utils.Ez.d(Unknown Source)
com.aspose.html.utils.Ez.a(Unknown Source)
com.aspose.html.utils.Ez.d(Unknown Source)
com.aspose.html.utils.Ez.c(Unknown Source)
com.aspose.html.utils.DU.a(Unknown Source)
com.aspose.html.utils.QK.a(Unknown Source)
com.aspose.html.utils.QN.a(Unknown Source)
com.aspose.html.utils.QJ$a.a(Unknown Source)
com.aspose.html.utils.QJ.a(Unknown Source)
com.aspose.html.utils.TO.a(Unknown Source)
com.aspose.html.utils.akS.au(Unknown Source)
com.aspose.html.utils.aok$a.av(Unknown Source)
com.aspose.html.utils.aok$a.a(Unknown Source)
com.aspose.html.utils.aok$a$8.a(Unknown Source)
com.aspose.html.utils.aok$a$8.invoke(Unknown Source)
com.aspose.html.utils.awy$k.hasNext(Unknown Source)
com.aspose.html.utils.aok$a.oh(Unknown Source)
com.aspose.html.utils.aok$a$a.hasNext(Unknown Source)
com.aspose.html.utils.aok.b(Unknown Source)
com.aspose.html.utils.aok.b(Unknown Source)
com.aspose.html.utils.aoe$3.c(Unknown Source)
com.aspose.html.utils.aoe$3.invoke(Unknown Source)
com.aspose.html.utils.dj.a(Unknown Source)
com.aspose.html.utils.aoe.a(Unknown Source)
com.aspose.html.utils.aoe$3.c(Unknown Source)
com.aspose.html.utils.aoe$3.invoke(Unknown Source)
com.aspose.html.utils.dj.a(Unknown Source)
com.aspose.html.utils.aoe.a(Unknown Source)
com.aspose.html.utils.aoe$3.c(Unknown Source)
com.aspose.html.utils.aoe$3.invoke(Unknown Source)
com.aspose.html.utils.dj.a(Unknown Source)
com.aspose.html.utils.aoe.a(Unknown Source)
com.aspose.html.utils.aoe$3.c(Unknown Source)
com.aspose.html.utils.aoe$3.invoke(Unknown Source)
com.aspose.html.utils.dj.a(Unknown Source)
com.aspose.html.utils.aoe.a(Unknown Source)
com.aspose.html.utils.aoe.a(Unknown Source)
com.aspose.html.utils.aoe.b(Unknown Source)
com.aspose.html.utils.aoe$30.a(Unknown Source)
com.aspose.html.utils.aoe$30.b(Unknown Source)
com.aspose.html.utils.aoe$1.w(Unknown Source)
com.aspose.html.utils.aoe$1.invoke(Unknown Source)
com.aspose.html.utils.awy$k.hasNext(Unknown Source)
com.aspose.html.utils.collections.generic.List.a(Unknown Source)
com.aspose.html.utils.collections.generic.List.<init>(Unknown Source)
com.aspose.html.utils.awy.ay(Unknown Source)
com.aspose.html.utils.aoe.a(Unknown Source)
com.aspose.html.utils.aoe.d(Unknown Source)
com.aspose.html.utils.aoe.b(Unknown Source)
com.aspose.html.utils.aoe$30.a(Unknown Source)
com.aspose.html.utils.aoe$30.b(Unknown Source)
com.aspose.html.utils.aoe$1.w(Unknown Source)
com.aspose.html.utils.aoe$1.invoke(Unknown Source)
com.aspose.html.utils.awy$k.hasNext(Unknown Source)
com.aspose.html.utils.collections.generic.List.a(Unknown Source)
com.aspose.html.utils.collections.generic.List.<init>(Unknown Source)
com.aspose.html.utils.awy.ay(Unknown Source)
com.aspose.html.utils.aoe.a(Unknown Source)
com.aspose.html.utils.aoe.d(Unknown Source)
com.aspose.html.utils.aoe.b(Unknown Source)
com.aspose.html.utils.aoe.a(Unknown Source)
com.aspose.html.utils.aoe.b(Unknown Source)
com.aspose.html.utils.aoh.b(Unknown Source)
com.aspose.html.utils.aoh.c(Unknown Source)
com.aspose.html.utils.aoh$15.a(Unknown Source)
com.aspose.html.utils.aoh$15.a(Unknown Source)
com.aspose.html.utils.aoa.b(Unknown Source)
com.aspose.html.utils.aoh.c(Unknown Source)
com.aspose.html.utils.aoh.a(Unknown Source)
com.aspose.html.utils.anJ$9.c(Unknown Source)
com.aspose.html.utils.anJ$9.invoke(Unknown Source)
com.aspose.html.utils.dj.a(Unknown Source)
com.aspose.html.utils.anJ.a(Unknown Source)
com.aspose.html.utils.anJ.b(Unknown Source)
com.aspose.html.utils.anJ.a(Unknown Source)
com.aspose.html.utils.anJ.b(Unknown Source)
com.aspose.html.utils.anJ.a(Unknown Source)
com.aspose.html.utils.anJ$9.c(Unknown Source)
com.aspose.html.utils.anJ$9.invoke(Unknown Source)
com.aspose.html.utils.dj.a(Unknown Source)
com.aspose.html.utils.anJ.a(Unknown Source)
com.aspose.html.utils.anJ.b(Unknown Source)
com.aspose.html.utils.anJ.a(Unknown Source)
com.aspose.html.utils.anJ.b(Unknown Source)
com.aspose.html.utils.anJ.a(Unknown Source)
com.aspose.html.utils.anJ$9.c(Unknown Source)
com.aspose.html.utils.anJ$9.invoke(Unknown Source)
com.aspose.html.utils.dj.a(Unknown Source)
com.aspose.html.utils.anJ.a(Unknown Source)
com.aspose.html.utils.anJ.a(Unknown Source)
com.aspose.html.utils.anE$1.a(Unknown Source)
com.aspose.html.utils.anE$1.a(Unknown Source)
com.aspose.html.utils.anE.a(Unknown Source)
com.aspose.html.utils.anE.a(Unknown Source)
com.aspose.html.utils.aoc.a(Unknown Source)
com.aspose.html.utils.aoc.a(Unknown Source)
com.aspose.html.utils.aoc$b.hasNext(Unknown Source)
com.aspose.html.utils.collections.generic.List.a(Unknown Source)
com.aspose.html.utils.collections.generic.List.<init>(Unknown Source)
com.aspose.html.utils.awy.ay(Unknown Source)
com.aspose.html.utils.Qk.a(Unknown Source)
com.aspose.html.utils.Qk.a(Unknown Source)
com.aspose.html.utils.Qk.a(Unknown Source)
com.aspose.html.utils.Qi.g(Unknown Source)
com.aspose.html.utils.Rf.aet(Unknown Source)
com.aspose.html.utils.Rf.afd(Unknown Source)
com.aspose.html.utils.XL.a(Unknown Source)
com.aspose.html.rendering.HtmlRenderer.render(Unknown Source)
com.aspose.html.rendering.HtmlRenderer.render(Unknown Source)
com.aspose.html.rendering.HtmlRenderer.render(Unknown Source)
com.aspose.html.rendering.Renderer.render(Unknown Source)
com.aspose.html.rendering.Renderer.render(Unknown Source)
com.aspose.html.utils.hm.a(Unknown Source)
com.aspose.html.utils.hm.a(Unknown Source)
com.aspose.html.utils.hm.a(Unknown Source)
com.aspose.html.converters.Converter.convertHTML(Unknown Source)

Version aspose.html.23.11 for Java. Could you please help us?
Thank you

@gianfranco.dancelli

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): HTMLJAVA-1647

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

I am getting similar exception with Aspose PDF:
com.aspose.pdf.internal.ms.System.lh: element already exists

The stacktrace is different in my case.

com.aspose.pdf.internal.ms.System.lh: element already exists
        at com.aspose.pdf.internal.ms.System.Collections.Generic.l1f.lI(Unknown Source) ~[aspose-pdf-23.11.jar!/:na]
        at com.aspose.pdf.internal.ms.System.Collections.Generic.l1f.addItem(Unknown Source) ~[aspose-pdf-23.11.jar!/:na]
        at com.aspose.pdf.internal.l31u.l1if.lI(Unknown Source) ~[aspose-pdf-23.11.jar!/:na]
        at com.aspose.pdf.internal.l31u.l1if.lb(Unknown Source) ~[aspose-pdf-23.11.jar!/:na]
        at com.aspose.pdf.internal.l31u.l1if.lI(Unknown Source) ~[aspose-pdf-23.11.jar!/:na]
        at com.aspose.pdf.internal.l31u.l1if.lI(Unknown Source) ~[aspose-pdf-23.11.jar!/:na]
        at com.aspose.pdf.internal.l31u.l1if.lI(Unknown Source) ~[aspose-pdf-23.11.jar!/:na]
        at com.aspose.pdf.internal.l31u.l1if.lI(Unknown Source) ~[aspose-pdf-23.11.jar!/:na]

The following code on new Document(sourceFile, options) throws the exception.

public class HtmlToPDFConversionTest {


    @Test
    public void testHtmlToPDFConversion() {
        String sourceFile = "C:/Users/Lenovo/Downloads/sourceFile.html";
        Path documentPath = Paths.get("testpdf.pdf");
        HtmlLoadOptions options = new HtmlLoadOptions();
        options.setHtmlMediaType(HtmlMediaType.Print);
        try (Document document = new Document(sourceFile, options)) {
            document.save(documentPath.toString());
        }
    }
}

I am not sure if my issue is related with the one OP has asked. Would like to provide more info on code and environment where this is reproduced. Please let me know if this issue has been already identified, if not how to proceed from this point.

@PawanMadvit

If possible, can you please share your sample HTML file for our reference? We will generate a dedicated ticket for your case and share the ID with you.

Hi @asad.ali I have shared sample project on github at https://github.com/PawanMadvIT/aspose-html2pdf

After running the project the error is logged which you should see in console.

@adewua

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): HTMLJAVA-1665

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi @asad.ali I have subscribed to Enterprise support. I want you to escalate this issue and provide me resolution as per the paid support terms. I’d also like to know where i can see the status of issue.

@adewua

You should now have access to our paid support forum where you can please create a topic and mention the ticket IDs shared here in your post. Your tickets will be escalated to the highest priority accordingly.

The issues you have found earlier (filed as HTMLJAVA-1647) have been fixed in this update. This message was posted using Bugs notification tool by pavel.terechshenkov