Docx Compare Tool



The GroupDocs.Comparison for .NET is a C# library which allows you to compare documents and find differences. Compare and merge Microsoft Word, Excel, PowerPoint, OpenDocument, PDF, Text, HTML and many other documents, retrieve a list of changes between source and target document(s), apply or reject changes and save results with GroupDocs.Comparison API. In addition to this, GroupDocs.Comparison can identify styling and formatting changes – like bold, italic, underlines, strikethroughs, font types, etc.

Docx Compare Tool

Changes detection algorithms used by GroupDocs.Comparison allows to detect differences in different document parts and blocks:

  • Text blocks – paragraphs, words and characters;
  • Tables;
  • Images;
  • Shapes etc.

Here are simple steps to compare two text files and show differences:

  • How To Use Text Comparison Tool. Our online text compare supports all popular type of document including word documents (.doc /.docx),.PDF, HTML and.txt files. You can also enter plain texts or webpage URLs to check similar text in both values.
  • Pandoc is a great tool for moving between HTML, docx, pdf, LaTeX, etc. You can use it to convert.docx files into markdown because that is a simple format that Git can work with. The default git diff on docx will tell you that an entire line has changed but leave it to you to figure out which words differ. When tracking your writing/edits, it.
  • WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.

I'm using Sourcetree to manage Microsoft Word documents (docx). I understand git/hg/etc. Aren't really designed for handling these binary files. I'd like to have a more usable diff for these documents. I have scripts that do two different kinds of diff: 1. Textual diff that converts the Word docs in.

  • Instantiate Comparer object with source document path or stream;
  • Call Add method and specify the target document path or stream;
  • Call Compare method.

The following code snippet demonstrates the simplest case of documents comparison using a couple lines of code.

Compare documents from local file

Compare documents from the stream

Let’s say you have two contracts in DOCX format that were concluded in different years. If you use the above code to compare these contracts, you get a DOCX file where the deleted elements are marked in red, the added in blue, and the modified in green as shown below:

Accept or Reject detected differences

GroupDocs.Comparison provides an ability to apply or discard specific changes between source and target documents and save the resultant document with (or without) selected changes.

The following are the steps to apply/reject changes to the resultant document.

  • Instantiate Comparer object with source document path or stream;
  • Call Add method and specify path target document path or stream;
  • Call Compare method;
  • Call GetChanges method and obtain detected changes list;
  • Set ComparisonAction of needed change object to ComparisonAction.Accept or ComparisonAction.Reject value;
  • Call ApplyChanges method and pass collection of changes to it.

The following code sample shows how to accept/reject detected differences.

Generate document pages preview

GroupDocs.Comparison allows to generate page previews for source, target and resultant document(s) using GeneratePreview method of a Document class.

PreviewOptions class is used to manage preview generation process – specify desired page numbers, image format etc.

The following are the steps to generate a document preview with GroupDocs.Comparison API:

  • Create a new instance of Comparer class and pass the source document path as a constructor parameter;
  • Add target document(s) to comparison using Add method;
  • Source and Targets properties of Comparer object allows to access source and target documents and provides GeneratePreview method;
  • Instantiate the PreviewOptions object with:
    • delegate for each page stream creation (see event handler CreatePageStream);
    • image preview format – PNG / JPG / BMP;
    • page numbers to process;
    • custom size of preview images (if needed).
  • Call GeneratePreview method of Source and Targets document and pass PreviewOptions to it.

Get page previews for resultant document

Compare multiple documents

GroupDocs.Comparison allows comparing more than two documents. The following code sample shows how to compare multiple documents programmatically.

Installation

NuGet is the easiest way to download and install GroupDocs.Comparison for .NET. Please get a temporary license to test the library without any functional restrictions.

Docx Compare Tool App

Please check the documentation to learn more about the library. We also offer free technical support so please feel free to contact us – we will be happy to help.


An Open Source Document Comparision Tool
by Arun Ravindran
Give instant feedback about Office Diff on twitter to arocks
Hi! This is the home page of Office Diff. You can find regular updates about the project here. Please check the news column on the left. Enjoy!

Check out the first release of Office diff, an open source, diff utility to compare two MS office documents (xls, xlsx, doc, docx, ppt, or pptx)

Screen shot of a color coded diff report between two Word 2007 (.docx) files

Comments

Docx File Comparison Tool

Please enter your feedback about the tool here. This is a forum where you can raise your queries, bugs or feature requests.

Software To Open Docx File

News
July 19, 2009
The first release of Office Diff is version 0.1.5
Download...
July 18, 2009
The project page at Sourceforge was created