THPDFJobProcessor.ExecuteLoadedOperationWithComparison

Executes an operation with an optional second borrowed document for generic or contract comparison

class function ExecuteLoadedOperationWithComparison(Document,
  ComparisonDocument: THotPDF; Op: THPDFJSONValue; Output: TStream = nil;
  Checkpoint: TNotifyEvent = nil): THPDFJSONValue;

The unit is HPDFDocJobs; the caller owns both documents, the operation, output, and returned JSON value

compare and compare.contract require two loaded documents; other operation kinds retain the behavior of ExecuteLoadedOperation

Comparison restores both documents' decode limits, stream thresholds, and AutoLaunch settings; annotation artifacts additionally roll back their graph transaction

Binary output is privately buffered and budget-checked before copying to the caller stream; a stream failure may leave accepted bytes in that output but does not commit source annotations

The checkpoint runs throughout comparison work and preserves cancellation and budget exceptions

JSON comparison contract and examples