Compare multiple documents
Leave feedback
NoteThis feature is available only for Word documents, PowerPoint and Open Document presentations.
GroupDocs.Comparison allows you to compare more that 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 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:
import com.groupdocs.comparison.Comparer;
import java.nio.file.Path;
// ...
try (Comparer comparer = new Comparer("source.docx")) {
comparer.add("target.docx");
comparer.add("target2.docx");
comparer.add("target3.docx");
final Path resultPath = comparer.compare("result.docx");
}
The result is as follows:
import com.groupdocs.comparison.Comparer;
import java.nio.file.Path;
import java.io.FileInputStream;
import java.io.InputStream;
// ...
try (Comparer comparer = new Comparer(sourceInputStream)) {
comparer.add(targetInputStream1);
comparer.add(targetInputStream2);
comparer.add(targetInputStream3);
final Path resultPath = comparer.compare(resultInputStream);
}
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.