HPDFCompareContractSources
Unit: HPDFContractCompareCore; also exposed by the existing Windows HPDFContractCompare adapter
function HPDFCompareContractSources(const BeforeDocument, AfterDocument: THPDFContractDocumentSource;
const Options: THPDFContractCompareOptions; out Report: THPDFContractCompareReport;
CancellationToken: THPDFCancellationToken = nil): Boolean;
Run the portable semantic comparison core through bounded source callbacks; both sources require a nonnil context and assigned page-count, semantic-page and visible-box callbacks
Callbacks supply stable loaded page counts, THPDFSemanticTextLayout and finite visible page bounds in PDF user space; source implementations retain responsibility for extraction permissions and bounded decoding
The result is true only for a complete comparison; invalid inputs, empty or unextractable pages, cancellation and exhausted comparison budgets receive explicit report statuses