THPDFContentToken Record
表示單一內容串流 token(運算子或運算元),帶有來源位元組區間與內嵌影像承載
宣告
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 | Token 類別:ctOperator、ctOperandString、ctOperandHex、ctOperandName、ctOperandNumber 或 ctOperandArray |
Op | ctOperator token 的運算子文字,或名稱運算元的名稱字面值 |
StrBytes | 字串或十六進位運算元的原始位元組,含來源區間中的分隔符號 |
IsHex | 字串運算元以十六進位字串書寫時為 True |
NumValue | 數值運算元的值,含 TJ 調整字距的數值 |
Items | ctOperandArray token 的陣列承載 |
StartOfs | token 在來源內容串流中書寫位置的位元組偏移 |
EndOfs | token 結束後緊鄰的位元組偏移 |
InlineBytes | ID 與 EI 之間的原始影像資料;只有 BI 運算子 token 會承載它 |
InlineKeys | 正規化的 BI 鍵/值集合;BI 以外的 token 皆為空 |
使用說明
- token 是
THPDFPageDisplayList、解譯器裝置與運算子訪客的工作單元 StartOfs與EndOfs把比對到的字形對映回確切的運算元位元組,供搜尋與取代使用- 只有
BI運算子 token 承載內嵌影像資料;其餘 token 的InlineBytes與InlineKeys都保持空白