We are using Aspose.Total and we have a problem with Aspose.Words (which we are using for several years now). We just upgraded to the last version so that we can work with docx files.
We read the document file from a database and create a new document using a stream, the code is below:
byte[] arForm = GetDocumentFromDatabase(lDocumentID);
MemoryStream streamDoc = new MemoryStream();
streamDoc.Write(arForm,0,arForm.Length);
streamDoc.Seek(0, SeekOrigin.Begin);
Document doc = new Document(streamDoc);
This works fine for .doc (Word 200/2003 etc) but when we use .docx (Word 2007) file error occurs saying that it is an invalid file format. The exact error is:
Unknown file format.
Stack trace
at Aspose.Words.Document.?(Stream ?, LoadFormat ?, String ?)
at Aspose.Words.Document..ctor(Stream stream, String baseUri, LoadFormat loadFormat, String password)
at Aspose.Words.Document..ctor(Stream stream, String baseUri)
at Aspose.Words.Document..ctor(Stream stream)
I hope someone can help.
Best regards Patrick Keukens