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

Free Support Forum - aspose.com

DOCX to HtmlFixed conversion throws InvalidOperationException using C#

Hi,

I use this code to save a Word file (Aspose 19.4.0.0) as HTML with FixedSaveOption:

Document docF = new Document(“Annual Report_V5.docx”); Annual Report_V5.zip (779.3 KB)

HtmlFixedSaveOptions saveOption = new HtmlFixedSaveOptions();
saveOption.Encoding = Encoding.UTF8;
saveOption.FontFormat = ExportFontFormat.Ttf;
saveOption.ExportEmbeddedCss = true;
saveOption.ExportEmbeddedImages = true;
saveOption.ExportEmbeddedFonts = true;
saveOption.ExportEmbeddedSvg = true;
saveOption.PrettyFormat = true;
saveOption.CssClassNamesPrefix = “dm”;
using (MemoryStream origHtmlStream = new MemoryStream())
{
docF.Save(origHtmlStream, saveOption);
//Issue occurs in save method
}

Error Message is: Stack empty

Kind regards,
Guido

@Nachti

We have tested the scenario using the latest version of Aspose.Words for .NET 20.1 and have not found the shared issue. So, please use Aspose.Words for .NET 20.1.