Compare multiple documents

Note
This feature is available only for Word documents, PowerPoint and Open Document presentations.

GroupDocs.Comparison allows you to compare more than two documents.

To compare several documents, follow these steps:

  1. Instantiate the Comparer object. Specify the source document path or stream.
  2. Call the add() method and specify the target document path or stream. Repeat this step for every target document.
  3. Call the compare() method.

The following code snippets show how to several documents:

Compare several documents from a local disk

const comparer = new groupdocs.comparison.Comparer(sourceFile);
comparer.add(targetFile1);
comparer.add(targetFile2);
comparer.add(targetFile3);
const resultPath = comparer.compare(resultInputStream);

The result is as follows:

Compare several documents from a stream

const comparer = new groupdocs.comparison.Comparer(sourceInputStream);
comparer.add(targetInputStream1);
comparer.add(targetInputStream2);
comparer.add(targetInputStream3);
const resultPath = comparer.compare(resultInputStream);