Hi,
We are a licenced Aspose User and we are using Aspose Words to compare word documents using Document.Compare method. We have noticed that for Aspose Words, when we try to compare two documents then the document that we get, from the Document.Compare method after accepting revision, has no BookmarkStart and BookmarkEnd node for many paragraphs, due to which our functionality breaks, as we generate IDs for the paragraph blobs from Bookmark ID. The version that we are currently using for Aspose Word is 23.12.0.
I have verified that the bookmarks are there when I try to parse the parse paragraphs without any document comparison, it only seems to be the case when we compare documents. I have also attached the word files for your reference. After the comparison, the bookmarks for the paragraphs in the starting pages are missing. Here is also the code to reproduce the issue:
var v1 = Path.Join("TestFiles/bug2-v1-anm.docx");
var document1 = new Document(v1);
var comments = document1.GetChildNodes(NodeType.Comment, true);
comments.Clear();
document1.Revisions.AcceptAll();
document1.RemoveMacros();
var v2 = Path.Join("TestFiles/bug2-v1-anm.docx");
var document2 = new Document(v2);
comments = document2.GetChildNodes(NodeType.Comment, true);
comments.Clear();
document2.Revisions.AcceptAll();
document2.RemoveMacros();
var doc = document1;
var author = Guid.NewGuid().ToString();
doc.Compare(document2, author, DateTime.Now);
var revisions = doc.Revisions;
revisions.AcceptAll();
If you look in the doc object, you will not find the bookmark nodes for paragraphs.
This is a very critical issue for our application and would really appreciate if you can help us in this regard at your earliest. Thanks.
bug2-v2-anm.docx (157.3 KB)
bug2-v1-anm.docx (215.3 KB)