GroupDocs.Comparison allows you to apply or discard specific changes between the source and target documents and save the output document with (or without) the selected changes.
To apply/reject changes to the output document, follow these steps:
Instantiate the Comparer object. Specify the source document path or stream.
Call the add() method. Specify the target document path or stream.
Call the compare() method.
Call the getChanges() method to get the changes list.
Call the setComparisonAction() method of the appropriate change object. Specify the ComparisonAction.ACCEPT or the ComparisonAction.REJECT value.
Call the applyChanges() method. Specify the collection of changes.
The ApplyChangeOptions class includes the following properties:
getChanges is a list of changes that must be applied (or not) to the output document
isSaveOriginalState is an option to keep the original state of the compared result after applying changes
The following code snippets show how to accept/reject changes:
Accept or Reject changes for documents stored on a local disk