I compared with Spire two docx documents: before_changes.docx and after_changes.docx. Result has been produced in spire_result.docx
There is one major change in this two files: deleted word "ДИРЕКЦИЯ" in after_changes.docx
But in spire_result.docx you can see changes in style in every string, despite there were no such changes in after_changes.docx
We compared changes in before_changes.docx and after_changes.docx with Microsoft Word in-app tool, with all enabled options, including formatting. The result is correct, as expected.
The Microsoft Word comparison result is in ms_word_result.docx
Comparison code^
- Code: Select all
public void CompareDocuments(byte[] firstContent, byte[] secondContent, string author = "default_author")
{
Document firstDoc = new();
Document secondDoc = new();
using (MemoryStream resultStream = new(), firstStream = new(firstContent), secondStream = new(secondContent))
{
firstDoc.LoadFromStream(firstStream, Spire.Doc.FileFormat.Auto);
secondDoc.LoadFromStream(secondStream, Spire.Doc.FileFormat.Auto);
firstDoc.Compare(secondDoc, author, DateTime.Now);
firstDoc.SaveToStream(resultStream, Spire.Doc.FileFormat.Docx);
}
}
Environment: ОС - Windows 10 64bit , MS Word 2016
Version of product: Spire.Office 6.7.0