Find Differences in PDF – Accept or Reject Changes in C#

You might be looking for an API that provides the ability to find differences in PDF and also allows you to apply or discard specific changes between source and target documents. For sure, you need to save the resultant document with or without selected changes.

API to Compare PDF, then Accept and Reject found differences

GroupDocs.Comparison for .NET is a back-end API that can be integrated into any .NET (existing or new) application without any third party tool/software dependency. Currently, API supports all these file formats.

Steps to Apply/Reject Changes

  • Instantiate Comparer object with source document path or stream
  • Call Add method  and specify path target document path or stream
  • Call Compare method
  • Call GetChanges method and obtain detected changes list
  • Set ComparisonAction of needed change object to ComparisonAction.Accept or ComparisonAction.Reject value
  • Call ApplyChanges method and pass collection of changes to it

ApplyChangeOptions Class

Changes – List of changes that must be applied (or not) to the resulting document.

You can see that in “without change.pdffile the text “Powerful document comparison APIs” is not highlighted which means its the rejected one. A complete list of changes is available in ChangeInfo.

Please access API from download section. Feel free to share your concerns on forum.