Loading HTML Document Throws FileCorruptedException

Hello


Having the the following HTML throws an exception:

  • TEST1

  • TEST2

  • ----------------------
    com.aspose.words.FileCorruptedException: The document appears to be corrupted and cannot be loaded.
    at com.aspose.words.FileFormatUtil.zzY(Unknown Source)
    at com.aspose.words.Document.zzY(Unknown Source)
    at com.aspose.words.Document.zzZ(Unknown Source)
    at com.aspose.words.Document.(Unknown Source)
    at aspose.sandbox.Application.main(Application.java:28)
    Caused by: java.lang.NullPointerException
    at com.aspose.words.zzZY1.zzZS4(Unknown Source)
    at com.aspose.words.zzZXJ.zzT(Unknown Source)
    at com.aspose.words.zzZXJ.zzZ(Unknown Source)
    at com.aspose.words.zzZXJ.zzP(Unknown Source)
    at com.aspose.words.zzZXJ.zzQ(Unknown Source)
    at com.aspose.words.zzZXJ.zzP(Unknown Source)
    at com.aspose.words.zzZXJ.zzQ(Unknown Source)
    at com.aspose.words.zzZXJ.zzP(Unknown Source)
    at com.aspose.words.zzZXJ.zzQ(Unknown Source)
    at com.aspose.words.zzZXJ.zzZ(Unknown Source)
    at com.aspose.words.zzZXJ.zzZ(Unknown Source)
    at com.aspose.words.Document.zzY(Unknown Source)
    … 3 more


    Yes I know the second LI is missing the parent UL tag, interesting is if I remove the first UL block then the document is loaded without error:

  • TEST2

  • This happens with the current version 14.8.0, it used to work a few versions back, don’t know the exact version though.

    This is the code I use:


    String base = “issue17/”;

    Document doc = new Document(base + “Document.html”, new LoadOptions(LoadFormat.HTML, null, null));
    doc.save(base + “/Document.doc”, SaveFormat.DOC);

    Hi Peter,

    Thanks for your inquiry.

    I
    have tested the scenario and have managed to reproduce the same issue
    at my side. For the sake of correction, I have logged this problem in
    our issue tracking system as WORDSNET-10758. I have linked this forum
    thread to the same issue and you will be notified via this forum thread
    once this issue is resolved.

    We apologize for your inconvenience.

    The issues you have found earlier (filed as WORDSNET-10758) have been fixed in this .NET update and this Java update.


    This message was posted using Notification2Forum from Downloads module by aspose.notifier.