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.
Thanks,
David
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, IEnumerable
1 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