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

Free Support Forum - aspose.com

Cannot save to HTML


I cannot save a document to HTML using Aspose.Words JAVA

Here is the very simple code I use :

public static void main(String[] args) throws Exception {
    License lic = new License();
    Document doc = new Document("Docs\test.doc");
    doc.save("Docs\OUTPUT_ASPOSE.html", SaveFormat.HTML);

And the exception I got :

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/stream/XMLOutputFactory
at com.aspose.words.internal.dv.(Unknown Source)
at com.aspose.words.gr.(Unknown Source)
at com.aspose.words.dh.(Unknown Source)
at com.aspose.words.ei.b(Unknown Source)
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at MainXHTMLGenerator.main(MainXHTMLGenerator.java:205)

I also attached a document I cannot save to this format.

Thank you.

Thanks for your request. It seems that you missed to add references to jsr173_1.0_api.jar and sjsxp.jar.
Best regards.