THPDFContentToken 记录
表示一个内容流令牌(操作符或操作数),带有其源字节区段和内联图像负载
声明
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;
单元
HPDFContentStream
字段
| 字段 | 用途 |
|---|---|
Kind | 令牌类别:ctOperator、ctOperandString、ctOperandHex、ctOperandName、ctOperandNumber 或 ctOperandArray |
Op | ctOperator 令牌的操作符文本,或名称操作数的名称字面量 |
StrBytes | 字符串或十六进制操作数的原始字节,源区段中包含定界符 |
IsHex | 字符串操作数以十六进制字符串形式书写时为 True |
NumValue | 数值操作数的值,包括 TJ 字距调整 |
Items | ctOperandArray 令牌的数组负载 |
StartOfs | 令牌在源内容流中书写位置的字节偏移 |
EndOfs | 刚好越过令牌之后的字节偏移 |
InlineBytes | ID 与 EI 之间的原始图像数据;只有 BI 操作符令牌携带它 |
InlineKeys | 规范化的 BI 键/值集合;BI 以外的所有令牌都为空 |
使用说明
- 令牌是
THPDFPageDisplayList、解释器设备和操作符访问器的工作单元 StartOfs和EndOfs把匹配到的字形映射回确切的操作数字节,便于查找和替换- 只有
BI操作符令牌携带内联图像数据;其余令牌的InlineBytes和InlineKeys都为空