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

Free Support Forum - aspose.com

Document.Compare generates incorrect revision after using InsertDocument method using Java

Example code:

Document document = new Document();
Document insertThis = new Document("insertthis.docx");
Document expected = new Document("expected.docx");
DocumentBuilder builder = new DocumentBuilder(document);
builder.insertDocument(insertThis, ImportFormatMode.KEEP_DIFFERENT_STYLES);
document.compare(expected, "test user", new Date());

The scenario is as follows. We are comparing a document with a different document that is created on the fly. The created document has another document inserted into it with builder.insertDocument(). The inserted document has an image inside of it. Comparing the first document with the created document now shows them as being unequal because of the image, even though the images are exactly the same. See the attached zip-file for an example.

documents.zip (1.5 MB)


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

We apologize for your inconvenience.


It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-20071) as ‘Not a Bug’.

Please note that Aspose.Words mimics the behavior of MS Word. MS Word marks images as different as well.