I have recently moved to a new information system. The new system stores report documents in a SQL database. I have created a simple app which retrieves the document as a byte array and passes to Aspose.Words for .Net. For documents created in the new system this works great, however our vendor converted documents from our old system, and when I try to open these I receive the error mentioned above. I can save the document to the file system, open it in Word, make any kind of change, and save. Then Aspose.Words will open the file properly. Unfortunately I can’t really make that process part of my automated system.
I am attaching a sample document with this problem. Any thoughts would be appreciated.
I am currently using Aspose.Word for .Net 13.8.0.0
The application is targeting .Net Framework 4.5
This happens both with my local test application running on Windows 7 64 bit and when running from my Web service which is running on a Windows 2003 server.
The Error returned is :
Aspose.Words.FileCorruptedException: The document appears to be corrupted and cannot be loaded. —> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at xaa035fc640f94856.x31a5ab258b5c21f3.x1e59dca0d9402f11(Int32 xc0c4c459c6ccbd00)
at xaa035fc640f94856.x2975a5323e39c83f.DoProcessTag(x0f8a9a895bdf560e docReader, Int32 itemIndex)
at xa604c4d210ae0581.x6baa4d96ef0dd487.xbf11ac143fca6897(Int32 x2865e605e9fbfb80)
at x16f9a31f749b8bb1.x32eac27632acc346.xdf2cafeb128b2de9(xeedad81aaed42a76 x789564759d365819, xa52f2632c0ffdfaf xe08a26cc2b49f3aa, x98d75821045fe9bd xbb8131fb9e06f47f, Int32 xd4f974c06ffa392b, Int32 x961016a387451f05, Boolean x2ce649b040466d4d)
at x16f9a31f749b8bb1.x32eac27632acc346.xf59aaff7aa68ace1(x1a78664fa10a3755 x062aae8c9613eeaa)
at x16f9a31f749b8bb1.x32eac27632acc346.xb61b92627231b7a8(x98d75821045fe9bd xbb8131fb9e06f47f, Int32 x459133b45d02f55a, xb3ad27290106eaf4 x708efeab5b620f36)
at x16f9a31f749b8bb1.x32eac27632acc346.xbac2e778f3c6bad1(x98d75821045fe9bd xbb8131fb9e06f47f)
at x16f9a31f749b8bb1.x32eac27632acc346.x1f490eac106aee12(Int32 x828697433249d659, Int32 x961016a387451f05)
at x16f9a31f749b8bb1.x32eac27632acc346.x1f490eac106aee12()
at x16f9a31f749b8bb1.x0f8a9a895bdf560e.x06b0e25aa6ad68a9()
at Aspose.Words.Document.x5d4db34d48fb3129(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)
— End of inner exception stack trace —
at Aspose.Words.Document.x5d4db34d48fb3129(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)
at Aspose.Words.Document.x5d95f5f98c940295(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)
at Aspose.Words.Document…ctor(Stream stream, LoadOptions loadOptions)
at Aspose.Words.Document…ctor(Stream stream)
at Service.GetReport(Int32 UserID, String ExamID)