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

Free Support Forum - aspose.com

Error converting DocX with Watermark and Header/Footer to HTML

Hi,

I’m trying to convert a docx file to html using:

Document doc = new Document(“C:\ConvertMeToHTML.docx”);
doc.save(“C:\HTML.html”);

And this error showed up:

java.lang.NullPointerException
at com.aspose.words.sl.b(HtmlWriter.java:1143)
at com.aspose.words.sl.a(HtmlWriter.java:1121)
at com.aspose.words.sl.visitShapeStart(HtmlWriter.java:1087)
at com.aspose.words.Shape.a(Shape.java:106)
at com.aspose.words.CompositeNode.acceptCore(CompositeNode.java:595)
at com.aspose.words.Shape.accept(Shape.java:101)
at com.aspose.words.CompositeNode.acceptChildren(CompositeNode.java:631)
at com.aspose.words.CompositeNode.acceptCore(CompositeNode.java:602)
at com.aspose.words.StructuredDocumentTag.accept(StructuredDocumentTag.java:59)
at com.aspose.words.CompositeNode.acceptChildren(CompositeNode.java:631)
at com.aspose.words.CompositeNode.acceptCore(CompositeNode.java:602)
at com.aspose.words.Paragraph.accept(Paragraph.java:297)
at com.aspose.words.CompositeNode.acceptChildren(CompositeNode.java:631)
at com.aspose.words.CompositeNode.acceptCore(CompositeNode.java:602)
at com.aspose.words.HeaderFooter.accept(HeaderFooter.java:110)
at com.aspose.words.sl.a(HtmlWriter.java:441)
at com.aspose.words.sl.a(HtmlWriter.java:415)
at com.aspose.words.sl.e(HtmlWriter.java:373)
at com.aspose.words.sl.b(HtmlWriter.java:356)
at com.aspose.words.sl.writeBody(HtmlWriter.java:259)
at com.aspose.words.sl.Li(HtmlWriter.java:108)
at com.aspose.words.sl.a(HtmlWriter.java:60)
at com.aspose.words.sl.a(HtmlWriter.java:35)
at com.aspose.words.Document.a(Document.java:1277)
at com.aspose.words.Document.save(Document.java:708)
at com.aspose.words.Document.save(Document.java:668)

But when I converted the docx document to doc first before converting to HTML, everything went well. So upon trial-and-error, I found out that the watermark WITH header/footer was causing the error. Here are the test scenarios used (DocX to HTML):

1. DocX file with watermark - Successfully converted to HTML
2. DocX file with header/footer - Successfully converted to HTML
3. DocX file with header/footer and watermark - Error encountered
4. Used DocX on item 3 and removed header/footer manually, left watermark - Error encountered

Attached is the document used for this test.

Would appreciate if you could advise us asap.

Thanks Aspose Team.

By the way, I’m using Aspose.Words 10.0.0 for Java.

Thanks!

Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

Best regards,

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


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