Product: GroupDocs.Comparison for Java 26.9
Platform: Java 21, macOS and Linux (Docker)
Summary
When an edit pushes later content onto the next page, ComparisonDisplayMode.SIDE_BY_SIDE reports the displaced content as deleted on its original page and inserted on the next one, even though its text is unchanged. Side-by-side seems to compare page N of the source with page N of the target, rather than the documents as a whole.
A side effect: the displaced lines are diffed letter by letter against the unrelated inserted lines they are paired with. That produces scattered partial highlights, where single letters inside words are left unmarked.
INLINE mode compares the same files correctly: only the inserted lines are marked. So cross-page matching works in the engine, just not in side-by-side mode.
Steps to reproduce
Attached: old.pdf, new.pdf, Repro.java, and MakeRepro.java, which rebuilds both PDFs using only PDFBox 3.x. Both are laid out 18 lines per Letter page.
old.pdf: page 1 has 4 intro lines, 4 lines starting “Curabitur pretium…” and 10 filler lines. Page 2 has 4 tail lines.new.pdf: the same text with 14 lines (“Insertum 1…14”) inserted after the intro. That fills page 1, so everything after it moves to page 2 unchanged.
Repro.java compares them with default PdfCompareOptions, once per display mode.
Expected: in both modes, only the 14 “Insertum” lines are marked as inserted.
Actual (side-by-side), see out-side-by-side-page1.png and -page2.png:
- Page 1: all 14 displaced lines are marked as deleted, with letter-level fragments.
- Page 2: the same 14 lines are marked as inserted.
Actual (inline), see out-inline-page1.png and -page2.png:
- The comparison is correct: only the “Insertum” lines are marked.
- Page 2 draws the old page-2 lines on top of the displaced lines. This looks related to our inline overprint report.
What we tried in side-by-side mode
setDetalisationLevel(LOW | HIGH)andsetSensitivityOfComparison(25 | 90): output identical to the default.- As a diagnostic, we stacked each document’s pages onto a single tall page before comparing. Then side-by-side was correct as well.
Question
Can side-by-side use the same document-level matching that inline mode uses? Or is there an option we’ve missed that enables it?
groupdocs-pagination-repro.zip (605.0 KB)