DOCX comparison with INCLUDEPICTURE erroneously adds r:link attribute and corresponding rel

Comparing the following two documents:

before.docx (25.7 KB)
after.docx (53.2 KB)

yields the following result (Java, 22.5):

aspose-diff.docx (66.5 KB)

but Word yields this instead:

word-diff.docx (68.1 KB)

The important differences are:

  • Word preserves the existence of the fldChar nodes, which includes the INCLUDEPICTURE instrText.
  • Word does not add a r:link attribute to the a:blip node. Aspose.Words add this attribute that points to a new rel that includes the URL from the INCLUDEPICTURE instrText.

Word seems to prefer following the r:link attribute when displaying the document, and in cases where the INCLUDEPICTURE was pointing to an unreachable URL (for instance, if the URL requires authentication, or was a local path on the original author’s disk), Aspose’s addition of the r:link attribute can break Word or other systems that attempt to follow the link instead of the r:embed.

Tracked internally as #14662.

@epaulet-society I have reproduced and logged the issue as WORDSNET-24494. We will keep you informed and let you know once it has been resolved. We apologize for your inconvenience.

1 Like

@epaulet-society please consider the following code

LoadOptions lo = new LoadOptions();
lo.PreserveIncludePictureField = true;
Document doc1 = new Document("before.docx", lo);
Document doc2 = new Document("after.docx", lo);
doc1.Compare(doc2, "author", DateTime.Now);

Is this the result you wanted to achieve?

@epaulet-society Please note that I am planning going to close the previously created ticket WORDSNET-24494 as “not a bug”. If you still have questions about this case, we will be happy to help you.