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

Free Support Forum - aspose.com

Aspose.Words File Corrupted Exception

Hi,

I have attached the document that contains 3 images which throws a FileCorruptedException when trying to save as a HTML.

Could you let me know what might be the reason for this?

Aspose.Words for .NET Version 15.8.1.0

Exception:
Aspose.Words.FileCorruptedException: The document appears to be corrupted and cannot be loaded. ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: offset
at System.Web.HttpInputStream.Seek(Int64 offset, SeekOrigin origin)
at .()
at .(Stream )
at .()
at .(Stream )
at Aspose.Words.Document.(Stream , LoadOptions )
--- End of inner exception stack trace ---
at Aspose.Words.Document.(Stream , LoadOptions )
at Aspose.Words.Document.(Stream , LoadOptions )

Code:
Aspose.Words.Saving.HtmlSaveOptions saveOptions = new Aspose.Words.Saving.HtmlSaveOptions()
{
AllowNegativeIndent = true,
SaveFormat = SaveFormat.Html,
ImagesFolder = destinationFolder,
ImagesFolderAlias = destinationFolder,
ExportHeadersFootersMode = Aspose.Words.Saving.ExportHeadersFootersMode.FirstPageHeaderFooterPerSection,
};
Document doc = new Document(inputStream);

Thanks,
Stallin

Hi Stallin,


Thanks for your inquiry.

We have tested the scenario using latest version of Aspose.Words for .NET 15.10.0 and have not found the shared issue. Please use latest version of Aspose.Words and let us know if you have any more queries.