Free Support Forum -

Get all changes including deletion, insertion and modification for all elements in PDF like images or tables in Java


I am evaluating “GroupDocs.comparison”, what we need,

(1)Input two PDF files
(2)Do “compare” for all elements in sequence in pdf files
(3)Return List where xxxx = insertion/deletion/modification

Current sample code only write out the diff to a pdf file.

(1)Could you provide a sample code which return
Return List where xxxx = information about insertion/deletion/modification

(2)We have “” license, if we only purchase
“GroupDoc.Comparison”, what is the price?




Thanks for taking interest in GroupDocs.Comparison for Java and posting your concerns. Yes, currently API compares two documents and write out the difference or highlight the style changes to a PDF document.
This is how you can highlight the style change:

ComparisonSettings settings = new ComparisonSettings();   

Using this code you can get differences, style changes (with highlighting) and comparison summary in the output document.

However, returning just the information about style changes is concerned, we are investigating this at our end. Your investigation ticket ID is COMPARISONJAVA-445. As we have any update on it, we shall notify you.

You have to purchase GroupDocs.Total for Java or GroupDocs.Comparison for Java license in order to utilize this API.
Please see license types and you can buy license from here. Furthermore, if you have any purchase related inquiry, feel free to post here.


We have an update regarding COMPARISONJAVA-445. You can return style changes as follows:

 ComparisonSettings settings = new ComparisonSettings();
 Comparer comparer = new Comparer();
 ICompareResult result ="source file path", settings);
 ChangeInfo[] changes = result.getChanges();
 final ArrayList<ChangeInfo> changeInfos = new ArrayList<>(Arrays.asList(changes));
 CollectionUtils.filter(changeInfos, new Predicate() {
      public boolean evaluate(Object o) {
           ChangeInfo changeInfo = (ChangeInfo) o;
           return changeInfo.getType() == TypeChanged.StyleChanged;
 int iasd = changeInfos.size();

You have to add common-collection dependency in order to use filter method: