Hello,
I am using Aspose.Words version 4.2.6.0.
I am using the following method to merge the documents.
protected void AppendDocuments(Aspose.Words.Document dstDoc, Aspose.Words.Document srcDoc)
{
foreach (Section srcSection in srcDoc)
{
Node dstSection = dstDoc.ImportNode(srcSection, true, ImportFormatMode.KeepSourceFormatting);
dstDoc.AppendChild(dstSection);
}
}
Everything works fine when I try to merge documents on my local machine. When I put the same code on the production server, the code fails for some of the word documents. It works for most of the documents, but for few documents it fails. I copied the documents that were failing on the production server to my local machine and executed my code locally and it worked perfectly on my machine. But on the production server these documents are failing.
The general exception it throws on the production server is:
Error Message:The document appears to be corrupted and cannot be loaded.
at Aspose.Words.Document.x5d95f5f98c940295(Stream xcf18e5243f8d5fd3, LoadFormat xdef7b99b7fc67519, String xe8e4b5871d71a79a)
at Aspose.Words.Document..ctor(String fileName, LoadFormat loadFormat, String password)
Any help is greatly appreciated.