DOCX to HTML conversion fails with "Stack empty" error message

Dear Aspose team,

We have a docx file that cannot be saved as html with our, following code and save options:

HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.Html);
options.ImagesFolder = "doc_files";
options.ImagesFolderAlias ="doc_files";
options.ExportHeadersFootersMode = ExportHeadersFootersMode.FirstSectionHeaderLastSectionFooter;
Aspose.Words.Document doc = new Aspose.Words.Document(inputFilePath);
doc.Save(outputFilePath, saveOptions);

We get the following exception:

System.InvalidOperationException occurred
  HResult=-2146233079
  Message=Stack empty.
  Source=mscorlib
  StackTrace:
       at System.Collections.Stack.Peek()
       at     . (Shading  )
       at     .       (Paragraph  )
       at     .VisitParagraphStart(Paragraph  )
       at Aspose.Words.Paragraph.r3ka8zscesabkstb24kjjv9sml9wq7pw   (DocumentVisitor  )
       at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
       at Aspose.Words.Paragraph.Accept(DocumentVisitor visitor)
       at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
       at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
       at Aspose.Words.Body.Accept(DocumentVisitor visitor)
       at     . (Node  )
       at     . (Body  )
       at     . (Section  )
       at     .  ()
       at     . ()
       at     . ()
       at     .       (      )
       at     .       (      )
       at Aspose.Words.Document. (      , SaveOptions  )
       at Aspose.Words.Document. (Stream  , String  , SaveOptions  )
       at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)

I am attaching the sample file. test.zip (106.0 KB)
Please let us know if we can provide any more details to help you fix the issue.

Best regards,

Daniel Lengyel
31564

@gergelyv,

While using the latest version of Aspose.Words i.e. 17.11, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-16143. Your request has also been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

@gergelyv,
The issues you have found earlier (filed as WORDSNET-16143) have been fixed in this Aspose.Words for .NET 18.1 update and this Aspose.Words for Java 18.1 update.
Please also check the following articles: