GroupDocs.Comparison for .NET 26.4 Release Notes
GroupDocs.Comparison version 26.4 focuses on significant improvements to PDF document comparison, introducing new display modes, page range filtering, and a dedicated PDF options class.
Full list of changes in this release
| Key | Category | Summary |
|---|---|---|
| COMPARISONNET-4732 | Enhancement | Optimized comparison performance for PDF documents |
| COMPARISONNET-4707 | Bug | Pdf with tables cause exception during processing |
| COMPARISONNET-4733 | Bug | Fixed embedded fonts handling logic in PDF comparison |
| COMPARISONNET-4725 | Feature | Ability to produce side by side PDF comparison result |
| COMPARISONNET-4731 | Feature | Ability to specify pages range for PDF documents comparison |
Major Features
⭐ Ability to produce side by side PDF comparison result
Two new display modes have been added to the new PdfCompareOptions class via the ComparisonDisplayMode enum:
SideBySide– each result page shows the source and target pages side by side. Deletions appear on the left (source side) and insertions on the right (target side). Content from the two documents never overlaps, making this mode ideal when documents differ heavily.Interleaved– produces a document with alternating pages: odd-numbered pages come from the source document (showing deletions) and even-numbered pages from the target document (showing insertions). Open the result in a PDF viewer with “Two Page View” to see each source/target pair side by side.
Note: The previous default behavior (a single merged document with highlighted insertions and deletions) is preserved as
ComparisonDisplayMode.Inlineand remains the default value.
Ability to specify pages range for PDF documents comparison
You can now limit PDF comparison to a specific range of pages using the PagesSetup property on PdfCompareOptions. When not set, all pages are compared as before.
using (var comparer = new Comparer("source.pdf"))
{
comparer.Add("target.pdf");
var options = new PdfCompareOptions()
{
CompareImagesPdf = true,
DisplayMode = PdfCompareOptions.ComparisonDisplayMode.SideBySide,
PagesSetup = new PagesSetup()
{
StartPage = 3,
EndPage = 10
}
};
comparer.Compare("result.pdf", options);
}
Public API changes
A new PdfCompareOptions class has been introduced for PDF-specific comparison configuration, following the same pattern as WordCompareOptions introduced in version 26.2.
PdfCompareOptions(namespaceGroupDocs.Comparison.Options)- Inherits from
CompareOptionsand adds PDF-only settings:- DisplayMode – controls how the PDF comparison result document is laid out; uses the
PdfCompareOptions.ComparisonDisplayModeenum; default value isInline(legacy behavior — single merged document with highlighted changes) - PagesSetup – specifies the page range to compare; when
null, all pages are compared - CompareImagesPdf – whether to compare images in PDF documents
- AnnotationAuthorName – the author name used for annotations when
DisplayModeis set toInterleaved - ImagesInheritanceMode – specifies the source of image inheritance when image comparison is disabled
- DisplayMode – controls how the PDF comparison result document is laid out; uses the
- Inherits from
PdfCompareOptions.ComparisonDisplayModeenum values:Inline(default) – legacy behavior; single merged PDF with deleted content highlighted in one color and inserted content in another. Content from both documents coexists on the same pages.SideBySide(new) – source and target pages appear side by side on each result page; no content overlap.Interleaved(new) – alternating source/target pages; best viewed in a “Two Page View” PDF reader.