Removing the first paragraph of the first section of a specific document makes its content corrupted.
Sample code:
using (FileStream fs = File.OpenRead(Server.MapPath("/File") + "\\content.docx"))
{
var wordDoc = new Document(fs);
wordDoc.FirstSection.Body.FirstParagraph.Remove();
wordDoc.Save(Server.MapPath("/File") + "\\output.docx");
}
By opening “output.docx” we will receive the corrupted content error.
Aspose.Words version: 21.10.0
I have attached the Web App reproducing this issue:
WebApp.zip (46.1 KB)