Get list of changes
GroupDocs.Comparison allows to obtain list of changes between source and target documents.
The following are the steps to obtain changes list.
- Instantiate Comparer object with source document path or stream;
- Call Add method and specify target document path or stream;
- Call Compare method;
- Call GetChanges method.
The following code sample shows demonstrates how to get list of all changes.
Get list of changes from local disk
using (Comparer comparer = new Comparer("source.docx"))
{
comparer.Add("target.docx);
comparer.Compare();
ChangeInfo[] changes = comparer.GetChanges();
}
Get list of changes from stream
using (Comparer comparer = new Comparer(File.OpenRead("source.docx")))
{
comparer.Add(File.OpenRead("target.docx));
comparer.Compare();
ChangeInfo[] changes = comparer.GetChanges();
}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
- GroupDocs.Comparison for .NET examples, plugins, and showcase
- GroupDocs.Comparison for Java examples, plugins, and showcase
- Document Comparison for .NET MVC UI Example
- Document Comparison for .NET App WebForms UI Modern Example
- Document Comparison for Java App Dropwizard UI Modern Example
- Document Comparison for Java Spring UI Example
Free Online App
Along with full-featured .NET library we provide simple, but powerful free Apps.
You are welcome to compare your DOC or DOCX, XLS or XLSX, PPT or PPTX, PDF, EML, EMLX, MSG and other documents with free to use online GroupDocs Comparison App.