Free Support Forum -

Error opening a Word file


Attached is a file that we cannot open. Aspose.Words returns an error message about a wrong number of bytes in an Escher record.

Is there anything you can do? Maybe the file is too corrupt for Aspose?

I have attached a sample file with as little text as possible in case it makes things simpler to you.

Claude Bédard

Hello!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for reporting this. But your document doesn’t open well with MS Word. After several seconds I see the message that there is not enough memory to show the image. If we suggest fixing this we only can absorb the exception, not recover that image. I think this idea is not good. Most probably this document was created with some third-party application. Please check that process if it’s possible.



I agree that the document seems to be flawed. We don't mind losing the image, so "absorbing the exception" would be quite acceptable to us. If for example the document as opened by Aspose skipped the image completely, with an indication typed into the document at the image location, this would be optimal for us.

But I am not sure that you want Aspose to cope with flawed documents beyond a certain point.

Claude Bédard

You are right. This is a philosophic question. Once we promise to handle somehow flawed documents we need to find that critical point and not go beyond it. One document would be semi-valid and even would be opened by MS Word without warnings. Another document would be opened but with some warning as yours. Third one would be even less valid but under some conditions there would be possible to cope with it.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

In this particular case there is an invalid escher. Length of some record contains garbage treated as a huge number and it is the best to throw an exception. Otherwise Aspose.Words would be less reliable and predictable.