Hi,
I have got an automated task in hand to compare same documents coming from different source to find out differences.
So far I am able to figure out the comparison code as per following but my management wants more details about each revision about the changes for example what color, style, margins, shapes, shapetypes, tables or any formatting were changed.
Do you have something handy or help me to extract as much as possible information out of it?
I preparing a visual tool with differences.
public int CompareDocs(string doc1Name, string doc2Name)
{
Aspose.Words.Document document1 = new Aspose.Words.Document(_DirectoryPath + doc1Name);
Aspose.Words.Document document2 = new Aspose.Words.Document(_DirectoryPath + doc2Name);
document1.Compare(document2, "VarunA", DateTime.Now);
string comparison = string.Empty;
int count = 0;
foreach(Revision revision in document1.Revisions)
{
count++;
comparison += $" Comparison { count.ToString() }. Revision Type: { revision.RevisionType.ToString() }";
if (revision.RevisionType != RevisionType.StyleDefinitionChange)
{
comparison += $" on a node of type : {revision.ParentNode.NodeType.ToString()}, ";
if(revision.ParentNode.NodeType == NodeType.Shape)
{
comparison += $" shape type : {(revision.ParentNode as Aspose.Words.Drawing.Shape).ShapeType.ToString()}, ";
}
comparison += $"Changed Text: {revision.ParentNode.GetText() }\n";
}
else
{
comparison += $" on a style : {revision.ParentStyle.Name} \n";
}
}
log.Info(comparison);
return count;
}