THPDFContentToken Record

Represents one content-stream token, operator or operand, with its source byte span and inline image payload

Declaration

THPDFContentToken= record
  Kind: THPDFContentTokenKind;
  Op: AnsiString;           // operator text (ctOperator) or name literal
  StrBytes: AnsiString;     // raw bytes of string/hex operand
  IsHex: boolean;
  NumValue: Double;         // numeric operand
  Items: THPDFArrayItems;   // ctOperandArray payload
  // StartOfs/EndOfs are byte offsets into the source content stream spanning
  // the operand as written. For a string/hex operand this covers the full
  // literal including its '(' ')' or '<' '>' delimiters; operators and
  // other operands record their span too. Search/replace uses these to map
  // a matched glyph back to the bytes that produced it
  StartOfs: Integer;
  EndOfs: Integer;
  // Inline image payload (only the 'BI' operator token carries these;
  // every other token leaves them at their default zeros). InlineBytes is
  // the raw image data between ID and EI; InlineKeys is the normalised
  // BI key/value set. Both default to empty when not an inline image
  InlineBytes: SysUtils.TBytes;
  InlineKeys: THPDFInlineImgKeys;
end;

Unit

HPDFContentStream

Fields

FieldPurpose
KindToken class: ctOperator, ctOperandString, ctOperandHex, ctOperandName, ctOperandNumber, or ctOperandArray
OpOperator text for ctOperator tokens, or the name literal for name operands
StrBytesRaw bytes of a string or hex operand, including delimiters in the source span
IsHexTrue when the string operand was written as a hex string
NumValueNumeric operand value, including TJ kerning adjustments
ItemsArray payload for ctOperandArray tokens
StartOfsByte offset of the token as written in the source content stream
EndOfsByte offset just past the token
InlineBytesRaw image data between ID and EI; only the BI operator token carries it
InlineKeysNormalized BI key/value set; empty for every token other than BI

Usage notes

Related APIs