TPDFPageSelectionAnalysis

Native Pascal, workflow preparation

Description

TPDFPageSelectionAnalysis is the summary returned by PLAnalyzePageSelection for one ordered page selection: total and distinct counts, the duplicate count, the smallest and largest page, and the maximal unit-step runs of the sequence.

Runs describe structure without changing the selection, and their offsets still point into the original array, so a caller can schedule ascending or descending runs separately while duplicates remain visible.

Syntax

Delphi

TPDFPageSelectionAnalysis = Record
  TotalCount, UniqueCount, DuplicateCount, MinPage, MaxPage: Integer;
  Runs: TPDFPageSelectionRuns;
End;

Fields

TotalCountNumber of entries in the selection, duplicates included
UniqueCountNumber of distinct page numbers
DuplicateCountTotalCount minus UniqueCount, that is the number of repeated entries
MinPageSmallest page number in the selection, or 0 for an empty selection
MaxPageLargest page number in the selection, or 0 for an empty selection
RunsMaximal unit-step runs of the selection, in selection order
Runs[].OffsetZero-based index of the first entry of the run in the selection
Runs[].CountNumber of entries in the run
Runs[].FirstPagePage number of the first entry of the run
Runs[].LastPagePage number of the last entry of the run
Runs[].Direction1 for an ascending run, -1 for a descending run and 0 for a singleton

Remarks

A run extends while consecutive pages differ by exactly 1 or -1 in the same direction; a duplicate, a gap or a direction change starts a new run.

For an empty selection the counts and bounds are zero and Runs is empty.

PLAnalyzePageSelection raises EConvertError for a non-positive page number or a selection longer than MaxPages.

See also

WorkflowDataTools, TPDFPageRangePages, TPDFPageSelectionBatches