Often when working with document management, you may encounter a situation where you need to compare large files that are similar to each other, but have slight differences that you would like to know about. And, of course, finding these changes manually is quite a time-consuming process.
GroupDocs.Comparison gives you many options for comparing a wide range of supported file formats, including PDF format.
After comparing the two Word files, you will get a resulting document in which the changes are highlighted in three different colors:
Elements that were inserted in the first file. – blue, by default
Elements wich were deleted from the first file – red, by default
Elements that have changed their styles (font, color, etc.) – green, by default
Source / Target / Result Words files
Source
Target
Result
The code sample to compare two Word files:
stringsourcePath=@"source.doc";// NOTE: Path to the source word documentstringtargetPath=@"target.doc";// NOTE: Path to the target word documentstringresultPath=@"result.doc";// NOTE: Path to the result word documentusing(Comparercomparer=newComparer(sourcePath)){comparer.Add(targetPath);CompareOptionscompareOptions=newCompareOptions{DetectStyleChanges=true,DetalisationLevel=DetalisationLevel.High};comparer.Compare(resultPath,compareOptions);}
More resources
Advanced Usage Topics
To learn more about document comparison features, please refer to the advanced usage section.
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
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.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.