Good day,
We’ve recently upgraded to Aspose.Words 21.6.0
We are generating a docx file from a docx template. When we save it to a stream and when we open the file, Word shows an error dialog that says “Word found unreadable content …”
Screen Shot 2021-07-01 at 4.55.17 PM.png (4.7 KB)
then I click yes and another dialog pops out
Screen Shot 2021-07-01 at 4.55.24 PM.png (67.5 KB)
When I try to look the footnotes and endnotes on the document, there is none.
However I discovered something. If I save it directly to my disk, the generated document has no error whatsoever.
Simplified code below:
byte[] byteArray = _aWSS3Service.DownloadFile("template_simplified.docx");
using (MemoryStream mem = new MemoryStream())
{
mem.Write(byteArray, 0, (int)byteArray.Length);
Document doc = new Document(mem);
// some logic here
mem.Position = 0;
doc.UpdateFields();
// this one creates the problem,
//file opens with error
doc.Save(mem, SaveFormat.Docx);
// saving it on the disk has no problem
// file opens with no error
doc.Save("C:\\test.docx", SaveFormat.Docx);
return mem.ToArray();
}
The thing is, we cannot write on the disk since our web app is hosted on AWS. I tried writing to AWS S3 storage but same error on the file.
I’m attaching a zip file with 3 files on it
- Template file
- Sample file - with no error (product on saving it directly on the disk)
- Sample file - with error, saving it on stream/memory
for aspose forum.zip (565.7 KB)