Compare Doc Functionality

Problem Explanation:

Issue:

When same document is processed twice with the same code. And then when both these output document are compared using aspose api, they found to be unequal.

Note : Compare code is also provided.

Folder Structure:

1) aspose_simple_update_code: This folder contains all the java sample code

2) data: This folder contains original docx and final document which gets genearted when you run the code.

Code Flow Understanding:

Handler.java: This is the file that takes all input and drives the code.

-This file needs two files and a author name as a input :
	
	1) orignal_docx =sample2.docx

	2) Aspose License.


-Output file generated will be sample2_edt_new.docx.


-When we run the code again on sample2.docx  as original_docx you will get sample2_edt_new_2.docx.(make sure to change output file name this time)

Comparing Output docx:

-When we compare these sample2_edt_new_2.docx and sample2_edt_new.docx using docx. We are getting empty revision.

Note:

  • I have attached a screenshot of the error for your reference.

  • I have also attached a zip that contains code and docx files.

empty_revision.png (32.5 KB)
aspose_simple_update_code.zip (289.3 KB)

@cacglo,
Unfortunately, we were unable to reproduce the same issue on our side. On my side, the “compare” block returns the following output:

No count issue
0

Also, the generated sample2_edt_new.docx document differs from the one, provided by you:

Could you please verify that the code you provided is correct?

update_code.zip (142.8 KB)
I ran the code on myside …it still gives me the same issue. I have attach the updated code.
kindly follow the instruction mention in the handler file.

@cacglo,
We are working over your query and will get back to you soon.

@cacglo,
Unfortunately, we still weren’t able to reproduce the same issue on our side. The two documents, “sample2_edt_11.docx” and “sample2_edt_12.docx”, generated on my side, are completely the same, and the comparing “if” block doesn’t return any count issue.

Could you please ZIP and attach the sample documents, generated by the program on your side? Also, could you please tell which version of Aspose Words do you use in your solution?

output_docx.zip (291.7 KB)
I have shared the two document genearted by the program on myside. I am using Aspose 19.11 version

@cacglo,
Thank you for additional information. It seems, that this issue is already fixed. The problem does not appear starting from 20.12 version of Aspose Words.
We suggest you please upgrade to the latest 22.1 version of Aspose.Words for Java.