[Defect] - Displayed content as edited without edit actual content in viewer

Scenario 1: Added one more bullet point at end of page.

  1. Attach 2 docx files attached (Source 1 && Target 1),
  2. Load Source 1 as source && Target 1 as Target files in model,
  3. Compare files by click compare button.

Actual:- Shown bullet point as edited in viewer, but actually not edited actually. However edit count shown correctly as 1.

Note:- Refer attachment (Resulted 1.png) for more details.

Scenario 2: Removed all content in target file with 2 steps.

  1. Attach 2 docx files attached (Leagal Content.docx && Legal content_delete_all_in_2_steps_v2.docx),
  2. Remove / Delete content in 1st page, and Remove all other content from 2nd page,
  3. Load Source && Target as Target files in model,
  4. Compare files by click compare button.

Actual:- Changes count shown wrongly.

Note:- Please refer “resulted File 2” for more reference.

Legal content_delete_all_in_2_steps_v2.docx (14.7 KB)

Legal content.docx (36.0 KB)

Resulted 1:

Legal content.docx (36.0 KB)

Target 1.docx (36.0 KB)

Resulted File 2:

@abhishek.sonkar

It seems you are experiencing issues with the comparison of DOCX files using Aspose.Words, specifically regarding the display of changes in the viewer. Here are some insights that may help you troubleshoot the problems you described in both scenarios:

Scenario 1: Added Bullet Point

In your first scenario, you mentioned that a bullet point was shown as edited in the viewer, even though it was not actually edited. This could be due to how the comparison algorithm interprets changes. To ensure accurate comparison results, you might want to consider the following:

  • Check Comparison Options: You can customize the comparison settings to ignore certain types of changes. For instance, if formatting changes are causing the bullet point to be flagged, you can set the comparison options to ignore formatting differences.

Scenario 2: Removed All Content

In the second scenario, where you removed all content in two steps, and the changes count was shown incorrectly, it might be beneficial to:

  • Use Granularity Settings: Adjusting the granularity of the comparison can help in accurately detecting changes. For example, you can set the granularity to character level to capture more detailed changes.

Example Code

Here’s a basic example of how to set up a comparison with custom options in Aspose.Words:

import com.aspose.words.*;

public class DocumentComparison {
    public static void main(String[] args) throws Exception {
        Document docA = new Document("Source.docx");
        Document docB = new Document("Target.docx");

        CompareOptions options = new CompareOptions();
        options.setIgnoreFormatting(true); // Ignore formatting changes
        options.setIgnoreHeadersAndFooters(true); // Ignore headers and footers

        docA.compare(docB, "user", new Date(), options);

        System.out.println("Changes count: " + docA.getRevisions().getCount());
    }
}

Additional Recommendations

  • Review Documentation: It may be helpful to review the Aspose.Words documentation on document comparison to understand the various options available and how they can affect the results.
  • Check for Updates: Ensure you are using the latest version of Aspose.Words, as updates may include bug fixes and improvements related to document comparison.

If the issues persist, consider providing more details or examples of the documents you are comparing, as this may help in diagnosing the problem further.

Sources

@abhishek.sonkar

The behavior is expected. Aspose.Words comparison result is the same as MS Word comparison result. Here is the result produced by MS Word for Scenario 1:
ms.docx (35.4 KB)

The behavior is expected. Aspose.Words comparison result is the same as MS Word comparison result. Here is the result produced by MS Word for Scenario 2:
ms.docx (39.8 KB)

Hi @alexey.noskov
For case 1 it is showing bullets to be formatted but I am unable to see the same behavior in ms-doc file here.

@abhishek.sonkar Could you please elaborate what format revision you mean. I see only one delete revision in the output just like in MS Word:


test_files_for_case_1.zip (132.1 KB)