FindInstructionsInRect
Content stream editing
Description
Returns instruction-index ranges whose painted content intersects the axis-aligned rectangle from (Left, Top) to (Right, Bottom), expressed in default user space (bottom-left origin, points)
Syntax
Delphi
Function TPDFContentProgram.FindInstructionsInRect(Left, Top, Right, Bottom: Double; Out Ranges: Array Of TPDFInstructionRange; IncludeText: Boolean= True): Integer;Parameters
| Left | X coordinate of the left edge of the query rectangle |
|---|---|
| Top | Y coordinate of the top edge of the query rectangle |
| Right | X coordinate of the right edge of the query rectangle |
| Bottom | Y coordinate of the bottom edge of the query rectangle |
| Ranges | Receives the matching instruction-index ranges, in ascending First order |
| IncludeText | Pass False to skip the estimated text-run pass, for callers that measure glyphs with the page fonts themselves; the default is IncludeText = True |
Return values
The number of ranges returned in Ranges
Remarks
The scan covers text-showing instructions (Tj, TJ, ', "), path-construction and paint ranges (m..re..f/S), and XObject Do draws
CTM tracking is approximate: it honours cm, q and Q for the common identity-CTM baseline (no transform) and for linear scales, so rotated or sheared CTMs may under- or over-report
Ranges come back in ascending First order; the caller should delete them descending to keep indexes stable
See also
TPDFContentProgram, GetTextRuns, EnumImagePlacements, ReplaceTextRun, TPDFInstructionRange