Wrong document compare

good day,

you can double check if this document has the same error or if it is something else.

Thank you in advance
TB
docA.docx (22.9 KB)

docB.docx (24.4 KB)

@benestom The latest 24.2 version of Aspose.Words does not see any differences in the attached documents and that is why the output document does not have any revisions.

yes, i have no difference either.
The problem is that I took the document and saved only part of it (section 45), saved it and sent it.
I am sending the original documents and look at page 45.
See photo
DocA:
3P254jV01.docx (309.7 KB)
DocB:
3P254jV627.docx (657.5 KB)
Diference:

@benestom Have you tried comparing the documents using MS Word? Is the result the same? I cannot compare them on my side because the second document is protected. Could you please share the password to unprotect the second document to compare the document using MS Word without involving Aspose.Words?

Password.zip (162 Bytes)

@benestom After unprotecting and saving the second document and further comparing the resulting document using Aspose.Words there are no differences on 45th page. So it looks like MS Word changes something in the document. I have simplified your documents manually in XML editor and found the difference is in internal hyperlink representation:
v1.docx (16.3 KB)
v2.docx (18.5 KB)

v1:

<w:hyperlink r:id="rId48" w:history="1">
	<w:r>
		<w:rPr>
			<w:rStyle w:val="Hyperlink" />
		</w:rPr>
		<w:t>RPPU</w:t>
	</w:r>
</w:hyperlink>

v2:

<w:r>
	<w:fldChar w:fldCharType="begin" />
</w:r>
<w:r>
	<w:instrText>HYPERLINK "https://linkproxy.cezdata.corp/bi-report-server/719?pIdentifikatorZaznamu=972371&amp;pSSDArray=%7B28;2021-10-12T13:25:12%7D"</w:instrText>
</w:r>
<w:r>
	<w:fldChar w:fldCharType="separate" />
</w:r>
<w:r>
	<w:rPr>
		<w:rStyle w:val="Hypertextovodkaz" />
	</w:rPr>
	<w:t>RPPU</w:t>
</w:r>
<w:r>
	<w:rPr>
		<w:rStyle w:val="Hypertextovodkaz" />
	</w:rPr>
	<w:fldChar w:fldCharType="end" />
</w:r>

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-26674

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

good day,
can i ask why WORDSNET-26674 is in closed state?

@benestom Yes, the issue is already resolved in the current codebase. The fix will be included into the next 24.4 version of Aspose.Words (April 2024). We will be sure to let you know once it is published.

The issues you have found earlier (filed as WORDSNET-26674) have been fixed in this Aspose.Words for .NET 24.4 update also available on NuGet.

Good day,
the error persists, please refer to page 42 - 43 - 44, contains links that are evaluated as a change.

@benestom
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-26873

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

good day, I still found one problem, I am sending whether it is the same or different. I am sending two documents. But it’s just an excerpt from a big documentary. If I compare the documents, the difference is whether I use:

docPrime10.Compare(docNew10, "test", DateTime.Now);

here it doesn’t identify the error for me
or:

Aspose.Words.Comparing.CompareOptions compareOptions = new Aspose.Words.Comparing.CompareOptions
{
    IgnoreFormatting = false,
    IgnoreCaseChanges = false,
    IgnoreComments = false, /// měnil 20.9.2021
    IgnoreTables = false,
    IgnoreFields = false,
    IgnoreFootnotes = false,
    IgnoreTextboxes = false,
    IgnoreHeadersAndFooters = true,
    IgnoreDmlUniqueId = true,
    Target = ComparisonTargetType.New
};
docPrime10.Compare(docNew10, "test", DateTime.Now, compareOptions);

Here it identifies the error for me

Please check.
TB

docNew10.docx (21.3 KB)

docPrime10.docx (20.2 KB)

@benestom Do you mean the difference in hyperlink? It looks like the same problem. Actually there is a difference in field codes of the problematic hyperlink. In one document hyperlink is not enclosed into double quotes in another document it is enclosed into double quotes in the hyperlink field code.

Thank you for the answer and explanation, I am still sending two documents, you will not wonder why the image is marked as changed when compared, but no one changed it.

docA.docx (51.4 KB)

docB.docx (51.8 KB)

@benestom Actually there are difference between shapes. If unzip DOCX document and compare you will see:
DocA

<v:shape id="_x0000_i1025" type="#_x0000_t75" style="width:340.5pt;height:574.5pt" o:ole="">

DocB

<v:shape id="_x0000_i1025" type="#_x0000_t75" style="width:338.12pt;height:576.22pt" o:ole="">

As you can see there is slight difference in shape size.

thank you for answer

1 Like

good day,
I also noticed that for one document, if I accept the revision marks in aspos, then after comparing the same document, changes occur between the documents. (compering primeAccept with prime)
If I accept revision marks in MS Word, there are no changes in the document.

docPrime = new Document(".../prime.docx");
if (docPrime.Revisions.Count > 0)
{
    docPrime.Revisions.AcceptAll();
}

docPrime.Save("C://temp/test/primeAccept.docx");

prime1TSD130_P01.docx.docx (30.4 KB)

@benestom Unfortunately, it is not quite clear how to reproduce the problem. You cannot compare document with revisions. Before comparison all revisions must be accepted. If possible could you please provide a full code or step by step manual how to reproduce the problem?

there are revision marks in the document, after acceptance, see the code and save, try to compare the documents in the MS Word application. Yes, you must accept revision marks again when comparing.
I am trying to create a simple example from multiple operations.

@benestom What document the output document produced by Aspose.Words should be compared with?
The first document is Aspose.Words document produced by the following code:

Document doc = new Document("in.docx");
doc .Revisions.AcceptAll();
doc .Save("first.docx"); //<----- this is the first document

What is the second document it should be compared with?