FileCurruptedException: The document appears to be corrupted and cannot be loaded


Our application converts tags like ##xxxx into actual values from our database by using the regEx replacements in Aspose words.

The code has been unchanged for years and it works great in most cases.

However, on passing the attached document through our application, we get an exception as below. Can you advise what is odd about this specific document that is choking Aspose Words?

[EndOfStreamException: Unable to read beyond the end of the stream.]
   System.IO.__Error.EndOfFile() +56
   System.IO.BinaryReader.FillBuffer(Int32 numBytes) +7670212
   System.IO.BinaryReader.ReadUInt16() +20
   ᝥ.᫦.᫪(BinaryReader ۪, Boolean ᫩, Boolean ᫫) +88
   ᰻.⑩.ክ(BinaryReader ۪, ֊ ᬙ) +540
   ᰻.⑩.⑫(BinaryReader ۪) +114
   ᜠ.␢.␾(֗ ๢, Int32 ␿) +58
   ᜠ.␢.␽(Char ᬗ, Int32 ᢻ, ֗ ๢, Ᲊ ᜴) +234
   ᜠ.␢.␷(֗ ๢, Ᲊ ᜴, ⑎ ␰, Int32 ງ, Int32 ؤ, Boolean ␸) +403
   ᜠ.␢.␶(୦ ᬔ) +275
   ᜠ.␢.␴(⑨ ␵) +47
   ᜠ.␢.␯(⑎ ␰) +632
   ᜠ.␢.Ⴆ(Int32 ␮, Int32 ؤ) +422
   ᜠ.␢.Ⴆ() +184
   ᜠ.ᜟ.߃() +784
   Aspose.Words.Document.Ӹ(Stream ӹ, LoadFormat Ӻ, String ӻ) +160
[FileCorruptedException: The document appears to be corrupted and cannot be loaded.]

Aspose.Words.Document.Ӽ(Exception ӽ) +73

Aspose.Words.Document.Ӹ(Stream ӹ, LoadFormat Ӻ, String ӻ) +512

Aspose.Words.Document…ctor(String fileName, LoadFormat loadFormat, String password) +126

Aspose.Words.Document…ctor(String fileName) +9

WordMerge.PopulateWordDocument() +95

WordMerge.Page_Load(Object sender, EventArgs e) +133

System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14

System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35

System.Web.UI.Control.OnLoad(EventArgs e) +99

System.Web.UI.Control.LoadRecursive() +50

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Hi Anthony,

Thanks for your inquiry. While using the latest version of Aspose.Words i.e. 10.6.0 and your input document, I managed to reproduce this issue on my side. I have logged this issue in our Issue Tracking System and your request has been linked to the appropriate issue. You will be notified as soon as it is resolved. Sorry for inconvenience.

Best Regards,

Thanks guys, in the meanwhile, if you can recommend what we can change in this document to make it work, that would be good too. Maybe I can request my client to slightly modify the document if you can identify a minor thing that can be modified to make it work!

Thanks for your request. As a temporary workaround, I can suggest to open save the document as DOCX in MS Word and use this DOCX instead of the original DOC.
Best regards,

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

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