Dear GroupDocs users, we’re pleased to announce GroupDocs.Comparison for Java 26.11. This release adds comparison of images by their recognised text (OCR), makes spreadsheet comparison match rows by content and run in seconds instead of minutes, and keeps the row heights, number types and highlight colours of spreadsheet results. It also lays out PDF results as GroupDocs.Comparison for .NET does, fixes text comparison across line breaks and several PDF, Word, presentation and HTML preview issues, and updates the bundled Aspose libraries. Some changes alter existing behaviour, so please review the section below before upgrading.
Behaviour changes to check before upgrading
- The published POM declares a new dependency, Aspose.OCR for Java, used only by OCR comparison. It brings ONNX Runtime with native libraries; if you do not use OCR, you can exclude it.
- Spreadsheet comparison reports different, and usually far fewer, changes when rows were inserted or deleted, because rows are now matched by content.
- PDF results are laid out differently: each component stays where it was on the source page.
- In text and inline PDF results, a replaced word or phrase now reads old first, then new.
- In evaluation mode, only the first 2 pages of a PDF are compared, as in .NET.
Feature — comparing images by recognised text
An image can now be compared by the text that Aspose.OCR reads in it instead of by its pixels, which suits scans, photos and screenshots of documents. The result shows the two images side by side with the changed words boxed, or, in TEXT mode, the recognised text alone with the changes marked. Each change is an OcrChangeInfo with the boxes it covers on both images and the recognition confidence. Aspose.OCR for Java has to be on the classpath; it is a dependency of the POM, not part of the jar. (COMPARISONNET-4925, COMPARISONNET-4934)
try (Comparer comparer = new Comparer("source.png")) {
comparer.add("target.png");
OcrOptions ocr = new OcrOptions();
ocr.setEnabled(true);
CompareOptions options = new CompareOptions();
options.setOcr(ocr);
comparer.compare("result.png", options);
}
Fix — spreadsheet rows matched by content
Rows were paired by index, so one inserted or deleted row made every row after it look rewritten, and the deleted row appeared as a deleted copy of the last row. Rows and columns are now aligned by the content of their cells: a workbook of six rows with one deleted went from 91 changes to 8: the six cells of that row, marked in place, and the row count on its summary sheet. (COMPARISONJAVA-1798, COMPARISONNET-4940, COMPARISONNET-4945)
Fix — spreadsheet comparison in seconds instead of minutes
Comparison time grew roughly with the cube of the number of cells, so two identical 200 × 20 sheets took 2.5 minutes. They now take under a second, and a 400 × 20 sheet with one row deleted about 7 seconds. The word diff behind every format got faster too, with the same results as before. (COMPARISONJAVA-1797, COMPARISONNET-4930)
Fix — spreadsheet results: row heights, number types, highlight colour
- Rows that the source fitted to their content were written with a fixed one-line height, clipping wrapped and large-font cells. They now stay fitted to their content. (COMPARISONJAVA-1796, COMPARISONNET-4946)
- Unchanged numbers and dates keep their type instead of being written as text. (COMPARISONNET-4947)
StyleSettings.setHighlightColornow fills the background of changed cells. (COMPARISONNET-4944)
Fix — text comparison across line breaks
An edit that lengthens a line of a text file pushes words across the following line breaks, and those words were reported deleted from one line and inserted into the next. Re-flowed lines are now compared as one run, and a replaced phrase is shown whole, old then new. (COMPARISONNET-4927, COMPARISONNET-4928, COMPARISONNET-4923)
Update — PDF result layout
PDF results are now laid out as in GroupDocs.Comparison for .NET. Every component stands where it was on the source page, images at their own coordinates and with the page’s vector graphics. Table cells wrap at their own edge, including merged cells, and pages that are the same in both documents are found anywhere in the document and skipped. (COMPARISONNET-4403, COMPARISONNET-4891)
Fix — PDF results
- An inline result shows a replaced phrase whole, old then new, instead of interleaving the words. (COMPARISONNET-4931)
- A line that a change made one word longer no longer wraps its last word onto the line below. (COMPARISONNET-4896)
- No second, black grid is drawn over a table’s own borders. (COMPARISONNET-4763)
- Changes on pages drawn through forms, as in spreadsheets saved as PDF, are now found.
- Lines of nothing but spaces are no longer reported as changes, and a table of contents keeps its page numbers on their lines.
Other fixes
- Word: a table column or row that became empty stays in place instead of being reported deleted and re-inserted. (COMPARISONNET-4926)
- Presentations:
LoadOptions.setSkipExternalResourcesandsetWhitelistedResourcesnow apply to presentations too. (COMPARISONNET-4880) - HTML preview: previews run at the same time no longer overwrite each other’s pages, and only the requested pages are returned. (COMPARISONNET-4935)
Update — Aspose libraries
The bundled Aspose libraries are updated: Aspose.Words 26.8, Aspose.Cells 26.9, Aspose.PDF 26.8.1, Aspose.Slides 26.9, Aspose.Diagram 26.9, Aspose.Email 26.8, Aspose.CAD 26.8, Aspose.PSD 26.8 and Aspose.BarCode 26.6. (COMPARISONJAVA-1794, COMPARISONJAVA-1795)
Resources