Wrong document compare

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?

“In” with “first” in MS Word, and you will find the differences

@benestom Unfortunately, I cannot reproduce the problem on my side. I have created a document using Aspose.Words using the following code:

Document doc = new Document(@"C:\Temp\in.docx");
doc.Revisions.AcceptAll();
doc.Save(@"C:\Temp\out.docx"); 

Then accepted all revisions in in.docx document and saved it as ms.docx.
Then compared out.docx with ms.docx documents using MS Word and MS Word does not show any changes in the document.
I compared out.docx with ms.docx documents using Aspose.Words and it also does not show any chnages:

Document doc_out = new Document(@"C:\Temp\out.docx");
Document doc_ms = new Document(@"C:\Temp\ms.docx");
doc_out.Compare(doc_ms, "AW", DateTime.Now);
Console.WriteLine(doc_out.HasRevisions);
doc_out.Save(@"C:\Temp\result.docx");

not possible.
I repeat everything:

Document doc = new Document(@"C:\Temp\in.docx");
doc.Revisions.AcceptAll();
doc.Save(@"C:\Temp\first.docx"); 

prime1TSD130_P01.docx.docx (30.4 KB)

first.docx (29.2 KB)

After open Application MS Word and compare “In” and “First”
“in” = “prime1TSD130_P01”
comparing


comparingAceptRevisionOnDocuments

And in result is revision mark - diference in dokument

comparedoc:

compare.docx (37.6 KB)

@benestom Thank you for additional information. I managed to reproduce the problem but only if accept revisions in the source document upon comparing documents. If accept revisions in the source document using MS Word and save it and then compare documents, MS Word does notsee any differences:
Aspose.Words: out.docx (29.2 KB)
MS Word: ms.docx (36.8 KB)

The same problem occurs if compare the source document with ms.docx if accept revisions in the source document upon comparing documents. So I do not see problem in Aspose.Words.