GroupDocs.Comparison at a glance

API to compare differences between documents in Java applications

Illustration comparison

File comparison in Java

Detect changes between source and target files at paragraph, word, and character levels. Identify styling and formatting changes such as bold, italic, underlines, strike-throughs, font types, and more.

Vast number of supported formats

With the GroupDocs.Comparison API, you can easily compare documents of multiple supported formats. This includes PDF, HTML, email, Microsoft Office Word documents, Excel spreadsheets, PowerPoint presentations, OneNote, Visio diagrams, texts, JPEG, PNG, GIF, and BMP images, as well as many other formats.

Apply or reject changes easily

Every difference between the compared documents can be applied or rejected and then exported to the output document.

Comparison summary report

Generate a summary report that lists all changes in the compared documents.

Platform independence

GroupDocs.Comparison for Java supports the following operating systems, frameworks and package managers

Amazon
Docker
Azure
Eclipse
IntelliJ
Windows
Linux
Maven

Supported file formats

GroupDocs.Comparison for Java supports operations with the following file formats.

Microsoft Office & OpenDocument formats

  • Word: DOCX, DOC, DOCM,DOT, DOTM, DOTX, RTX, RTF, TXT
  • Excel: XLSX, XLS, XLT, XLTM, XLSB, XLSM
  • PowerPoint: PPTX, PPT, POT, POTX, PPS, PPSX
  • Outlook: EML, EMLX, MSG
  • OneNote: ONE
  • OpenDocument: ODT, ODP, OTP, ODS, OTT
  • Fixed Page Layout: PDF

Images, Graphics & Diagrams

  • Raster images: BMP, GIF, JPG, JPEG, PNG
  • Medical Imaging: DICOM
  • Microsoft Visio: VSDX, VSD, VSS, VST, VDX
  • AutoCAD Drawing: DWG, DXF

Other

  • Text: TXT
  • Programming Languages: CS, Java, CPP, JS, PY, RB, PL, ASM, GROOVY, JSON, PHP, SQL, LOG, DIFF, LESS, SCALA
  • Web: HTM, HTML, MHT, MHTML
  • e-Books: MOBI, DjVu
  • Delimiter-Separated Values: CSV

GroupDocs.Comparison features

Easily compare PDF and Office documents, images and other formats

Feature icon

Easy to use document comparison

Easily analyze and pinpoint differences between two documents.

Feature icon

Compare multiple documents

Simultaneously examine and highlight variances across multiple documents.

Feature icon

Supported formats

Compatibility with over 50 widely-used document formats from diverse categories.

Feature icon

Accept or reject changes

Clear visualization of identified changes, with options to accept or reject modifications.

Feature icon

Generate previews

Capability to save comparison results as image previews.

Feature icon

Content comparison

Thorough comparison of text content on various levels - including line-by-line, paragraph, word, and character analysis, with emphasis on alterations.

Feature icon

Style comparison

Ability to detect and highlight alterations in formatting and style elements.

Feature icon

Set metadata

Option to retain metadata from source or target files, or permit user-defined metadata settings.

Feature icon

Password protection

Facilitates analysis of password-protected documents and enables password protection for the resultant documents.

Feature icon

Compare specific pages

Load and compare specific sections or pages of a document as required.

Feature icon

Display comments

Flexibility to display or conceal comments when loading the source document.

Code samples

Some use cases of typical GroupDocs.Comparison for Java operations

Comparing password-protected documents.

To compare documents that are protected with a password, you need to specify it then loading the documents:

How to compare password-protected documents.

// Load the source document and specify its password
try (Comparer comparer = new Comparer("source.docx", new LoadOptions("1234")))
{
    // Load the target document and specify its password
    comparer.add("target.docx", new LoadOptions("5678"));

    // Save comparison result to a specified file
    comparer.compare("result.docx");
}

Comparing multiple PDF documents.

GroupDocs.Comparison allows you to compare more than two documents. The operation is almost the same as when comparing two files. You just need to add more target files to the comparer class.

How to compare three or more documents.

// Load the source document
try (Comparer comparer = new Comparer("source.docx") 
{
    // Specify the second file for comparison
    comparer.add("target2.docx");

    // Specify the third file for comparison
    comparer.add("target3.docx");

    // Save comparison result to a specified file
    comparer.compare("result.docx");
}

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English