Accept or Reject revisions

GroupDocs.Comparison provides the ability to get revisions from a Docx file format, process and save the processing result. Below are the steps to take revisions from a document, accept / reject revisions, and write the processing result to a final file.

It is also possible to process all changes together, applying one action for all changes. Below are the steps to handle all changes:

ApplyRevisionOptions class:

  • getChanges - List of revision changes that need to be applied to the final document.
  • CommonHandler - Property that allows you to define one action to handle all revision.

If you do not pass the path or file to the resulting document to the ApplyRevisionOptions method, the changes will be written to the same file from which the revisions were taken.

The following code example demonstrates how to get revisions from a document, accept / reject detected revisions and save changes to the resulting document.

Accept or Reject revisions from local disk

Accept or Reject revisions from stream

Accept or Reject all revisions

Result of revision processing

Below are the source and output files based on the code presented earlier.

Source fileResult file

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, MSG and other documents with free to use online GroupDocs Comparison App.

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