aspose-compare.docx (10.3 KB)
no-xref.docx (12.9 KB)
word-compare.docx (13.1 KB)
xref.docx (13.0 KB)
Attached are two files, no-xref.docx
and xref.docx
. They are the same, but xref.docx
has some additional text and a cross-reference.
The file aspose-compare.docx
was created by comparing xref.docx
(as modified file) against no-xref.docx
(as original file) using Document.Compare
. When you go into the document, highlight the inserted cross-reference and run Update Field from the context menu, the result is Error! Reference source not found. This is especially a problem when the comparison file must be saved as PDF. Since saving as PDF (via Aspose) runs the Update Fields operation internally, the resulting PDF shows Error! Reference source not found. instead of the referenced paragraph number.
The file word-compare.docx
was created by running the same comparison using Word’s built-in Compare feature. Running Update Field in this file does not break the cross-reference; it behaves as expected. So, this appears to be a bug in the Aspose Document.Compare
feature.
In case helpful, my guess at what this bug is, is that Document.Compare
fails to include inserted bookmarks in the resulting document. Thus, the bookmark that is internally referenced by the inserted cross-reference is missing form the document, resulting in the error.