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

Free Support Forum - aspose.com

Save to HTML: Length cannot be less than zero. Parameter name: length

I have an in memory Word document that I am trying to save in 3 formats - docx, pdf & html. I can successfully save it in docx and pdf but when I try to save it as html I get the following exception:

Length cannot be less than zero. Parameter name: length

I have included the stack trace below.

I am saving a number of other documents in html format without any error. I have attached a copy of the saved docx & pdf documents. Can you tell me what might be causing this error.



Stack Trace:

at System.String.Substring(Int32 startIndex, Int32 length)
at .(String , String )
at .(Paragraph , )
at . (Paragraph , , )
at . (Paragraph )
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptChildren(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.AcceptCore(DocumentVisitor visitor)
at .(Section )
at . ()
at .()
at .()
at . (​ )
at Aspose.Words.Document.(Stream , String , SaveOptions )
at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)
at BTT.DocAssembler.WebSPA.Controllers.DocumentAssemblyController.ProcessItems(DocAssemblerDbContext db, IEnumerable1 items) in c:\Data\Development\Projects\DocAssembler\Source\BTT.DocAssembler.WebSPA\Controllers\DocumentAssemblyController.cs:line 724</div><div> at BTT.DocAssembler.WebSPA.Controllers.DocumentAssemblyController.ProcessSections(DocAssemblerDbContext db, IEnumerable1 sections) in c:\Data\Development\Projects\DocAssembler\Source\BTT.DocAssembler.WebSPA\Controllers\DocumentAssemblyController.cs:line 568
at BTT.DocAssembler.WebSPA.Controllers.DocumentAssemblyController.Assemble(Guid assembledDocId, Guid documentId, String signalRConnectionId) in c:\Data\Development\Projects\DocAssembler\Source\BTT.DocAssembler.WebSPA\Controllers\DocumentAssemblyController.cs:line 149

Through a process of elimination I was able to determine that the part of the document that is causing the error is the numbered list on page 2. If I remove points 5.1 through to 5.4 then the error goes away.

Hi David,

Thanks for your inquiry. I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-12051. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hello Tahir,

This is a bit of a “showstopper” for us. Can you give me any idea when this would be fixed? Do I need to purchase “priority support” to get a hotfix?



Hi David,

Thanks for your inquiry. I would like to
share with you that issues
are addressed and resolved based on first come first serve
basis. Currently, your issue is pending for analysis and is in the
queue. I am afraid, we can’t provide you any reliable estimate at the
moment. Once your issue is analyzed, we will then be able to provide you
an estimate.

Please check our support services from here:

Thanks for your patience and understanding.

The issues you have found earlier (filed as WORDSNET-12051) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.