CompareRenderedPagesWith
Document comparison, Rendering
Description
Compare two rendered pages and obtain difference artifacts
Syntax
Function TPDFlib.CompareRenderedPagesWith(Other: TPDFlib;
ThisPage, OtherPage: Integer; DPI: Double;
Const Options: TPDFVisualCompareOptions;
Out Comparison: TPDFVisualCompareResult; Out ErrorText: WideString): Boolean;Remarks
Returns True when rendering and comparison complete, including when the pages differ; returns False with ErrorText and an empty result on invalid input, render failure, or unequal dimensions
Page numbers are one-based and are validated without clamping; both selected pages are restored after rendering
Use PLDefaultVisualCompareOptions from PDFlibVisualCompare; ColorTolerance is an inclusive per-channel threshold from 0 to 255, TileSize groups adjacent changed tiles, and IgnoreRects contains top-left half-open pixel rectangles
Set IncludeMask for one byte per pixel (255 changed, 0 unchanged or ignored) and IncludeOverlay for an RGB copy of the second page with changed pixels tinted red; the changed ratio excludes ignored pixels
The result contains actual changed bounds and counts; empty changed bounds serialize as null; at most 64M pixels and 4M tiles are accepted
The inputs use their configured renderer, crop, scale, color, annotation, and form settings; configure both instances consistently when comparing document content