THPDFContentToken Record
Representa um token de content stream, operador ou operando, com o span de bytes de origem e o payload de imagem inline dele
Declaração
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;
Unidade
HPDFContentStream
Campos
| Campo | Finalidade |
|---|---|
Kind | Classe do token: ctOperator, ctOperandString, ctOperandHex, ctOperandName, ctOperandNumber ou ctOperandArray |
Op | Texto do operador para tokens ctOperator, ou o literal do nome para operandos de nome |
StrBytes | Bytes brutos de um operando de string ou hex, incluindo os delimitadores no span de origem |
IsHex | True quando o operando de string foi escrito como string hex |
NumValue | Valor do operando numérico, incluindo ajustes de kerning TJ |
Items | Payload de array para tokens ctOperandArray |
StartOfs | Offset de byte do token como escrito no content stream de origem |
EndOfs | Offset de byte logo após o token |
InlineBytes | Dados brutos da imagem entre ID e EI; só o token do operador BI os carrega |
InlineKeys | Conjunto de chave/valor BI normalizado; vazio para todo token que não seja BI |
Notas de uso
- Tokens são a unidade de trabalho de
THPDFPageDisplayList, dos devices interpretadores e dos visitors de operadores StartOfseEndOfsmapeiam um glyph encontrado de volta aos bytes exatos do operando para busca e substituição- Só o token do operador
BIcarrega dados de imagem inline; todos os demais tokens deixamInlineByteseInlineKeysvazios