Accept or Reject detected changes

GroupDocs.Comparison provides an ability to apply or discard specific changes between source and target files and save resultant document with (or without) selected changes. 

The following are the steps to apply/reject changes to resultant file.

ApplyChangeOptions class:

  • getChanges() - Array of changes that must be applied (or not) to the resulting document;
  • setSaveOriginalState - Keep the original state of the compared result after applying changes.

The following code sample shows how to accept/reject detected changes.

Accept or Reject changes for documents stored at local disk

Accept or Reject changes for documents provided as a stream

The following code sample shows how to accept/reject detected changes using SaveOriginalState option

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured Java library we provide simple, but powerful free Apps. You are welcome to compare your DOC or DOCX, XLS or XLSX, PPT or PPTX, PDF, EML, EMLX, MSGand other documents with free to use online GroupDocs Comparison App.

© Aspose Pty Ltd 2001-2022. All Rights Reserved.