Comparing two word documents content using aspose.words

how to compare two word documents content using aspose.words?

Hello

Thanks for your request. Unfortunately, Aspose.Words does not provide a document comparison feature. We will consider adding such feature in one of future versions of Aspose.Words, but unfortunately I cannot promise you that this feature will be available any time soon.
MS Word documents are very complex and it is very difficult to compare them. If you need just compare content of documents, you can convert both documents to txt and compare two strings. See the following link to learn how to convert document to string:
https://docs.aspose.com/words/java/extract-selected-content-between-nodes/

Another option is using WordML to compare documents, you can convert documents to WML (XML) format and compare them using XML DOM. However, as you may understand there can be fluctuation in any document format. It means that documents look the same when you open them in MS Word, but internally they are different.

Best regards,

Actually i need to compare text only. the way u said to convert word doc to text file…ok tht looks fine…actaully while comparing two documents …one document content is saving in datase in binary format…now i have to convert tht binary code to word document and then to text file and then comapre with other document(which i have to convert to text file) …is there any way to convert tht binary code to word document ?
for eaxmple my binary code in databse looks like given below
0x504B0304140000000800B05C393E2D

Hello
Thanks for your request. Please see the following clink to learn how to read a Document from the Database:
https://docs.aspose.com/words/net/serialize-and-work-with-a-document-in-a-database/
Best regards,

Here is an idea that worked for me
if you have two word documents the same look, but internal representation are different due to time signature or whatever of course you cannot compare them as strings
But you can compare them by converting them to .tiff format and compare them

doc1.Save("out1.tiff");
doc2.Save("out1.tiff");

var b1 = File.ReadAllBytes("_out1.tiff");
var b2 = File.ReadAllBytes("_out2.tiff");

if (b1.Length != b2.Length) return "Not Equal";
for (int i = 0; i <b1.Length; i++)
{
    if (b1[i] != b2[i]) return "Not Equal";
}
return "Equal";

Hi Sameh,

We always appreciate positive feedback from our customers.The WORDSNET-2385 is related to comparing document feature of MS Word. Please see the attached image for detail.

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

The issues you have found earlier (filed as WORDSNET-2385) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)