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
| TotalCount | Number of entries in the selection, duplicates included |
|---|---|
| UniqueCount | Number of distinct page numbers |
| DuplicateCount | TotalCount minus UniqueCount, that is the number of repeated entries |
| MinPage | Smallest page number in the selection, or 0 for an empty selection |
| MaxPage | Largest page number in the selection, or 0 for an empty selection |
| Runs | Maximal unit-step runs of the selection, in selection order |
| Runs[].Offset | Zero-based index of the first entry of the run in the selection |
| Runs[].Count | Number of entries in the run |
| Runs[].FirstPage | Page number of the first entry of the run |
| Runs[].LastPage | Page number of the last entry of the run |
| Runs[].Direction | 1 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