TPDFInlineBoundaryEvent
Data types, content stream editing
Description
TPDFInlineBoundaryEvent is the handler type of OnInlineImageBoundary. Parse calls it for every BI keyword it meets, before any instruction is produced for that image, and uses the returned position to capture the entire BI..EI slice as one coBeginImage instruction.
When no handler is assigned, the parser proves the boundary itself from the image dictionary's declared width, height, bits per component, colour space and filter, and only scans for an EI token when that proof is inconclusive. Assigning a handler makes the boundary the application's responsibility.
Syntax
Delphi
TPDFInlineBoundaryEvent = Function(Const Source: AnsiString;
BIStart: Integer; Out AfterEI: Integer): Boolean Of Object;Parameters
| Source | The complete content stream being parsed; all positions index it one-based |
|---|---|
| BIStart | One-based position of the BI keyword |
| AfterEI | Out parameter: one-based position just past the terminating EI token |
Return values
| True | The boundary is proven and AfterEI is used, provided it passes the parser's validation |
|---|---|
| False | The boundary could not be proven; parsing stops and returns False without falling back to a guessed delimiter |
Remarks
The returned position is validated: it must lie more than four bytes past BIStart, at most one byte past the stream, and the two bytes before it must read EI. A value that fails any of these checks also fails the parse.
The handler type is method-based (Of Object), so it can be a method of any object; assign it before calling Parse, because the property is only consulted while parsing.
See also
OnInlineImageBoundary, Parse, TPDFContentProgram, TPDFContentInstruction, ReplaceInlineImage