Compare files, update change actions, and apply them to the output.
importgroupdocs.comparisonasgcwithgc.Comparer("source.docx")ascomparer:comparer.add("target.docx")comparer.compare()changes=comparer.get_changes()# Example: reject the first changeifchanges:changes[0].comparison_action=gc.ComparisonAction.REJECTwithopen("result.docx","wb")asout_stream:comparer.apply_changes(out_stream,gc.ApplyChangeOptions(changes=changes))
🔹 Use case: Remove undesired edits from the final deliverable while keeping approved changes.
The result is as follows:
Accepted changes
Rejected changes
Accept or reject changes (streams)
Work entirely with streams and persist the merged result.