DEV Community

Cover image for In-depth document comparison
Atir Tahir
Atir Tahir

Posted on

In-depth document comparison

Do you want to compare documents with all small details? Have a look at the following .NET code:

Comparer comparer = new .Comparer(sourcePath);
comparer.Add(targetPath);
CompareOptions compareOptions = new CompareOptions();
StyleSettings changedStyleSettings = new StyleSettings();
changedStyleSettings.HighlightColor = Color.Red;
compareOptions.ChangedItemStyle = changedStyleSettings;
comparer.Compare(@"D:\result.docx", compareOptions);
Enter fullscreen mode Exit fullscreen mode

This is not it. This document comparison API provides a lot of comparison options and support for multiple file formats. The changes detection algorithms used by GroupDocs.Comparison allows to detect changes in different document parts and blocks.
From style changes (e.g. italic, bold, highlighted text) to the item insertion or deletion, everything will be compared.
Have a look at the following screenshot:
Alt Text

Top comments (0)