I have found what looks like a bug with Aspose.Words for .NET. We are using Aspose.Words.Document.Watermark.SetText()
and it appears three headers are implicitly created: One for default, one for first page, and one for even pages: (I’m using the Open XML SDK Productivity Tool just for viewing the components of the document)
image.png (86.0 KB)
The problem is each watermark shape has an id of PowerPlusWaterMarkObject100001
. When the document is opened in desktop Microsoft Word, it “fixes” the duplicates by changing the ids to something else. As a result, calling Aspose.Words.Document.Watermark.Remove()
doesn’t remove all of the watermarks. I attached a screenshot where you can see the shape id before Word modifies it:
image.png (81.7 KB)
here is a screenshot after Word modifies it:
image.png (82.4 KB)
I’m also attaching the original document with the duplicate ids:duplicateids.docx (13.0 KB)
And here is the document that has been changed:
corrputed.docx (18.1 KB)