Hi,
Aspose.Words for Java (tested v15.12.0.0) does not mimic Microsoft Word’s Compare feature, see attached image.
Word: 2 insertions. (two paragraphs, just as expected)
Aspose: 7 insertions & 1 deletion & 6 formattings.
The following code was used to create the files:
DocumentBuilder v1 = new DocumentBuilder();
v1.getDocument().getStyles().getByStyleIdentifier(StyleIdentifier.HEADING_1).getFont().setColor(Color.GRAY);
v1.getParagraphFormat().setStyleIdentifier(StyleIdentifier.HEADING_1);
v1.write("Technical");
v1.getDocument().save("v1.rtf");
DocumentBuilder v2 = new DocumentBuilder();
v2.getFont().setColor(Color.GREEN);
v2.writeln("This is");
v2.getFont().clearFormatting();
v2.getFont().setUnderline(Underline.SINGLE);
v2.getFont().setColor(Color.GREEN);
v2.writeln("Underlined");
v2.getFont().clearFormatting();
v2.getFont().setSuperscript(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("superscript");
v2.getFont().clearFormatting();
v2.getFont().setSubscript(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("hello");
v2.getFont().clearFormatting();
v2.getFont().setStrikeThrough(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("change");
v2.getFont().clearFormatting();
v2.getFont().setItalic(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("italic");
v2.getFont().clearFormatting();
v2.getDocument().getStyles().getByStyleIdentifier(StyleIdentifier.HEADING_1).getFont().setColor(Color.GRAY);
v2.getParagraphFormat().setStyleIdentifier(StyleIdentifier.HEADING_1);
v2.writeln("Technical");
v2.getDocument().save("v2.rtf");
v1.getDocument().compare(v2.getDocument(), "author", new Date());
v1.getDocument().save("diffAspose.rtf");
Thanks
Romain