GroupDocs.Comparison detects changes in text (paragraphs, words, characters), tables, images, and shapes across a wide range of formats — Word, PDF, Excel, PowerPoint, HTML, AutoCAD, Visio, Outlook, OpenDocument, images, and more. The full list is available on the Supported document formats page.
By default, GroupDocs.Comparison highlights detected changes with the following colours:
Inserted – blue
Deleted – red
Style changed – green
These are the defaults — you can override colours, fonts, and other styling via the InsertedItemStyle, DeletedItemStyle, and ChangedItemStyle properties. See Customize changes styles for details.
Basic comparison workflow
To compare two documents, follow these steps:
Instantiate the Comparer object with the source document path or stream.
Call the Add method and specify the target document path or stream.
To control how the comparison is performed and how the result is rendered, pass a CompareOptions object to the Compare method. These options work with any supported document format:
PdfCompareOptions — PDF-specific settings such as DisplayMode (Inline / SideBySide / Interleaved), page-range filtering, and PDF annotation author name.
Using a format-specific subclass is recommended when comparing a known document type — it makes Word-only or PDF-only settings discoverable and prevents you from passing irrelevant options.
Configure loading with LoadOptions
While CompareOptions controls how documents are compared, LoadOptions controls how the source and target files are loaded into the Comparer. It is passed to the Comparer constructor and to Add, before any comparison runs.