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

Free Support Forum - aspose.com

DOCX conversion to HTML fails with IndexOutOfRange exception

Hi Guys,

We are trying to convert the attached docx file to html with the following code:

Aspose.Words.Document asposeDocument = new Aspose.Words.Document(filePath);

HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.Html);
options.ImagesFolder = previewFolderName + @"" + workingFileName + “_files”;
options.ImagesFolderAlias = workingFileName + “_files”;
options.ExportHeadersFootersMode = ExportHeadersFootersMode.FirstSectionHeaderLastSectionFooter;

asposeDocument.Save(previewFolderName + @"" + workingFileName + “.html”, options))

The exception that we get is given below.

Please let us know when this issue is fixed.

Best regards,

Gergely Vándor

0028287

System.IndexOutOfRangeException occurred
HResult=-2146233080
Message=Index was outside the bounds of the array.
Source=Aspose.Words
StackTrace:
at xb3013071794e5415.xd17edb07eea89cb0.xae480b9fe9e0e9f7(x9b87766ad1dbe8d6 x7acb8518c8ed6133, PointF[] x6fa2570084b2ad39, xb8e7e788f6d59708 x08ce8f4769eb3234, xcd7d6e7318ee6574 x0f7b23d1c393aed9)
at xb3013071794e5415.xd17edb07eea89cb0.xb2b6ea820737e805(PointF[] x6fa2570084b2ad39, xcd7d6e7318ee6574 x0f7b23d1c393aed9, x9b87766ad1dbe8d6 x7acb8518c8ed6133, Boolean x559292b5f7ade8c2)
at xb3013071794e5415.xd17edb07eea89cb0.x22eeb7dfd7bac3bd(PointF[] x6fa2570084b2ad39, xcd7d6e7318ee6574 x0f7b23d1c393aed9, x9b87766ad1dbe8d6 x7acb8518c8ed6133, Boolean xd925f447ef7e00a4, Boolean x559292b5f7ade8c2)
at xb3013071794e5415.xd17edb07eea89cb0.x02c01e0bd89aaaa0(PointF[] x6fa2570084b2ad39, xcd7d6e7318ee6574 x0f7b23d1c393aed9, x9b87766ad1dbe8d6 x7acb8518c8ed6133, Boolean xd925f447ef7e00a4, Boolean x559292b5f7ade8c2)
at xb3013071794e5415.x55970cc410f6a88f.xe406325e56f74b46(x43c3197706cb18d9 x7458794d854f9b68, xcd7d6e7318ee6574 x0f7b23d1c393aed9)
at xad5c68c1ad3b0224.x958ddf7e6db1ce94.xe406325e56f74b46(x43c3197706cb18d9 x7458794d854f9b68, xcd7d6e7318ee6574 x0f7b23d1c393aed9)
at xb3013071794e5415.x6f0dc7da3e6e3517.x1c68e9c95170be3b(x958ddf7e6db1ce94 xe640ebcce83ddadc)
at xb3013071794e5415.x6f0dc7da3e6e3517.x330e6a8b60947cb4()
at xb3013071794e5415.x6f0dc7da3e6e3517.xe406325e56f74b46()
at xb3013071794e5415.x6d22cf1ff5170ee8.xe406325e56f74b46()
at xb3013071794e5415.x6d22cf1ff5170ee8.xe406325e56f74b46(xd4e66257276c6905 x02726bba19c4d190, xcd7d6e7318ee6574 x0f7b23d1c393aed9)
at xad5c68c1ad3b0224.xd4e66257276c6905.Render(x2094302a66c2ec77 nodeRenderParams)
at x996431aaaaf00543.x3064c6a807d3a0a8.x5b81632e5b71b64c(XmlDocument x5510939d5b9dcd91, SizeF xbc26217ba3290abe, x56ef2519e07fdbb4 x10154c16e21df88a)
at x3d94286fe72124a8.x73d966e39902908a.xe406325e56f74b46(x7721ad963b03c6eb xa3d15e542708d37f)
at Aspose.Words.Rendering.ShapeRenderer…ctor(DrawingML shape)
at x13cd31bb39e0b7ea.xcc0b5baa75272714.x1056c53fc7967a3d(DrawingML xb3c5925d90ebc5f0)
at x13cd31bb39e0b7ea.xcc0b5baa75272714.VisitDrawingML(DrawingML drawingML)
at Aspose.Words.Drawing.DrawingML.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Paragraph.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Tables.Cell.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Tables.Row.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Body.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Section.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Document.Accept(DocumentVisitor visitor)
at x13cd31bb39e0b7ea.xcc0b5baa75272714.x18dfca7c5fd2402f(x8556eed81191af11 x5ac1382edb7bf2c2)
at Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String xafe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)

InnerException:

Hi István,


Thanks for your inquiry. After an initial test with Aspose.Words for .NET 16.5.0, I was unable to reproduce this issue on my side. I would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link. I hope, this helps.
http://www.aspose.com/downloads/words/net

Best regards,
Hi,

We have upgraded to the latest version, and the issue does not occur anymore.
Thank you.

Best regards,
Gergely Vándor

Hi Gergely,


Thanks for your feedback. It is great that latest version of Aspose.Words resolves this issue. In case you have further inquiries or need any help, please let us know.

Best regards,