Compare multiple documents
NoteThis 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:
- Instantiate the
Comparer
object. Specify the source document path or stream. - Call the
add()
method and specify the target document path or stream. Repeat this step for every target document. - Call the
compare()
method.
The following code snippets show how to several documents:
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:
const comparer = new groupdocs.comparison.Comparer(sourceInputStream);
comparer.add(targetInputStream1);
comparer.add(targetInputStream2);
comparer.add(targetInputStream3);
const resultPath = comparer.compare(resultInputStream);