IllegalStateException on node save to HTML

I have a paragraph Node. When I try to save this Node to HTML using the toString(SaveFormat.HTML) method, I get the following error:

java.lang.IllegalStateException
	at com.aspose.words.zzZSV.endElement(Unknown Source)
	at com.aspose.words.zzZU8.endParagraph(Unknown Source)
	at com.aspose.words.zzZWU.zzD(Unknown Source)
	at com.aspose.words.zzZJE.visitParagraphEnd(Unknown Source)
	at com.aspose.words.Paragraph.zzY(Unknown Source)
	at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
	at com.aspose.words.Paragraph.accept(Unknown Source)
	at com.aspose.words.zzZWU.zzZr(Unknown Source)
	at com.aspose.words.zzZWU.zzZt(Unknown Source)
	at com.aspose.words.zzZWK.zzZq(Unknown Source)
	at com.aspose.words.Node.toString(Unknown Source)
	...

Using deepClone seems to work around the issue i.e. this works just fine:

p.deepClone(true).toString(SaveFormat.HTML)

Using Aspose.Words for Java 18.8.

@rocketraman

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please create a simple Java application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

The input document is 8MB+ and contains proprietary information. Where can I send it?

@rocketraman

Please ZIP your project (including the input document), upload to some file hosting service e.g. Dropbox and share the download link here for testing. We will investigate the issue on our end and provide you with more information.