GroupDocsGists
10/24/2017 - 8:23 AM

propertiesOfICompareResult.java

// For complete examples and data files, please go to https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java
String sourcePath = Utilities.sourcePath + sourceFile;
String targetPath = Utilities.targetPath + targetFile;

Comparer comparer = new Comparer();
ICompareResult result = comparer.compare(sourcePath, targetPath, new ComparisonSettings());
//Save result document to file
result.saveDocument(Utilities.outputFileName(extension));

//Get stream of result document
InputStream resultStream = result.getStream();

/**Save images of result document to folder**/
//result.saveImages(Utilities.outputFileName(".jpg"));

/**Get images of result document as array of streams**/
//List<InputStream> imgStreams = result.getImages();

//Get array of changes
ChangeInfo[] changes = result.getChanges();

//Update changes in CompareResult object (this method updated result document)
result.updateChanges(changes);

/**To update changes use the following algorithm:**/		
//Set actions of changes as Accept or Reject

/*ChangeInfo[] changes = result.getChanges();
changes[0].setAction(ComparisonAction.Accept);
changes[1].setAction(ComparisonAction.Reject);
result.updateChanges(changes);*/