Save Word DOCX Document to HTML File using C# code of Aspose.Words for .NET API | Avoid Attempted to Divide by Zero

Hi,

As I am saving docx (word) file to html file using Aspose.words for .Net version 20.7.0.0.It gives exception.

Please provide any solution for this.

Word file link is above https://drive.google.com/file/d/1zisljkeue1-itfm5gfxsxxbj9jkd0f0h/view?usp=sharing

Stacktrace of exception given below

Attempted to divide by zero.   at    .(String , Boolean , Boolean )
   at    .(​   , ChartAxis )
   at    .(ChartSeries , ​   , Int32 , Int32 , ​   )
   at    .(RectangleF ,     )
   at    .()
   at    .()
   at    .()
   at    .(ShapeBase ,     )
   at ​  .       (    )
   at    .(ShapeBase )
   at    .(ShapeBase ,     )
   at    .(ShapeBase ,  ​  )
   at    .( ​  , Boolean )
   at    .( ​  )
   at Aspose.Words.Rendering.ShapeRenderer..ctor(ShapeBase shape)
   at    .(ShapeBase , ​   )
   at    .(ShapeBase , ​   , Boolean )
   at    .       (ShapeBase )
   at    .(ShapeBase , StoryType , Boolean )
   at    .(Shape , StoryType , Boolean )
   at    .VisitShapeStart(Shape )
   at Aspose.Words.Drawing.Shape.r3ka8zscesabkstb24kjjv9sml9wq7pw    (DocumentVisitor )
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.Drawing.Shape.Accept(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
   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 Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.Section.Accept(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
   at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
   at Aspose.Words.Document.Accept(DocumentVisitor visitor)
   at    .(​   )
   at    .       (Node )
   at Aspose.Words.Node.ToString(SaveOptions saveOptions)
   at Convertor.WORDToHTML.ConvertContent()
   at PDFConvertor.HtmlConversion.DocumentConversion(DocumentConversionQueue queue) in e:\SourceCode\CarbonSeekingAlpha\Carbon4.0\PDFConvertor\HtmlConversion.cs:line 97

@ashishsinghvi,

After an initial test with the licensed [latest (20.10) version of Aspose.Words for .NET]https://releases.aspose.com/words/net/, we were unable to reproduce this exception on our end. We used the following simple code to test the scenario on out end:

Document doc = new Document("C:\\Temp\\sampledoc.docx");
doc.Save("C:\\Temp\\20.10.html");

So, we suggest you to please upgrade to the latest version of Aspose.Words. In case the problem still remains, then please also create a standalone simple Console application (source code without compilation errors) that helps us to reproduce your current problem on our end and attach it here for testing. Please do not include Aspose.Words DLL files in it to reduce the file size.