We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Comparing word documents - showing image differences though no changes in images

When we are comparing two word documents, Aspose API is showing image differences though no changes in images between the two word documents.

We are using following API to compare two Word documents using Aspose.Words for Java Version 15.7 (aspose-words-15.7.0-jdk16.jar).

==> Document.compare(Document document, java.lang.String author, java.util.Date dateTime)

Attached the two documents used for the comparison for this case:
* “SourceDoc.docx” – source doc
* “TargetDoc.docx” – source doc modified to this doc

If you see these documents… there are only textual changes… but there are no changes to images… But still Apsose API shows two revision types, namely, INSERTION and DELETION for each image in the document (BUG).

Attached “Compare_by_Aspose.docx” which is the result of comparing source and target documents by Aspose API.

Attached “Compare_by_MS_Word_CompareDocuments.docx” – result of comparing source and target documents by MS Word application by going to MS Word -> Review tab -> Select Compare -> Select two files… This doesn’t show any difference in images!!

Am i doing anything wrong?
How to handle this?
Can you please fix this issue?

Thanks,
-Satya

Hi Satya,

Thanks for your inquiry.
Please read the general limitation of Document.Compare method from here:
http://www.aspose.com/docs/display/wordsjava/How+to+Compare+Two+Word+Documents

I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-12338. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

I saw the limitation, it says "Dml - Fallback shapes is compared instead of actual Dml comparison."

What is fallback shape?

Hi Satya,

Thanks for your inquiry. The images are imported in Shape node type in Aspose.Words DOM. SaveOptions.DmlRenderingMode allows users to control how DrawingML shapes are rendered to fixed page formats. It has two possible values:

1. Fallback (default mode) - Aspose.Words checks whether DrawingML has fallback shape and if so, renders fallback shape. This is behavior of earlier versions of Aspose.Words, so users will not see any difference in their documents.

2. DrawingML - In this mode Aspose.Words ignores fallback shape and render DrawingML itself.

Please note difference in right arrow and smiley face rendering in Fallback and DrawingML modes in attached images.

Hi Satya,

Thanks for your patience. Shapes are really not changed but they located in documents in different order.

Consider simplier example. We have two documents. First have two
images: Image1, Image2 and second document has the same images but in
reversed order: Image2, Image1. See attached files “in(A).docx” and
“in(B).docx”. The only way to make in(A).docx be in(B).docx is to delete
image and insert it again but in different place. If you compare it
using Word you’ll see that Word do the same - it deletes and inserts
images.

Actually this should be under Move revision here but currently it’s not supported by Aspose.Words compare document feature.

Could you please share if you have another ideas about expected comparison output?


Hi Tahir,
When tested with Aspose version 15.8, some of the earlier issues with images gone away.

Your testcase talks about reversing the images… But i am still seeing the issue even without changing the images direction.

Taks the attached documents R5.docx and R5_2.dox…
=> Aspose gives difference saying img1 and img2 inserted and deleted… it doesn’t say the same for img3 (little better than version 15.7).
=> For the same, MS Word doesn’t give any difference for img1 and img2.

Can please explain why Aspose doing so for img1 and img2?

We expect the result to be similar to that of MS Word.

Note: However if you start a brand new document, and copy the content from
R5_2.doc and paste in this, then Aspose will not give the difference
around img1 and img2. Not sure why…

-Satya

Hi Satya,

Thanks

for sharing the detail.

I am in communication with our product team
about this issue and we will update you via this forum thread
asap.

The issues you have found earlier (filed as WORDSNET-12338) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.