TPDFOpGroup
Data types, content stream editing
Description
TPDFOpGroup classifies content stream operators into the 16 groups of ISO 32000-1 Table 50, plus ogUnknown for anything outside that table. The classification is static: PDFContentOpInfo carries one group for every TPDFContentOperator value, so no parsing state is involved.
InstructionGroup returns the group of one parsed instruction, FindNextGroup locates the next instruction belonging to a group, and FindNextOp searches by exact operator instead. Group searches are useful when any colour operator, any text-positioning operator or any painting operator will do.
Syntax
Delphi
TPDFOpGroup = (ogUnknown, ogGeneralGS, ogSpecialGS, ogPathConstruction, ogPathPainting, ogClipping, ogTextObject, ogTextState, ogTextPositioning,
ogTextShowing, ogColor, ogShading, ogInlineImage, ogXObject, ogMarkedContent, ogCompatibility, ogType3);Values
| ogUnknown | Not a Table 51 operator; also the result of InstructionGroup for an out-of-range index |
|---|---|
| ogGeneralGS | General graphics state: w J j M d ri i gs |
| ogSpecialGS | Special graphics state: q Q cm |
| ogPathConstruction | Path construction: m l c v y h re |
| ogPathPainting | Path painting: S s f F f* B B* b b* n |
| ogClipping | Clipping: W W* |
| ogTextObject | Text objects: BT ET |
| ogTextState | Text state: Tc Tw Tz TL Tf Tr Ts |
| ogTextPositioning | Text positioning: Td TD Tm T* |
| ogTextShowing | Text showing: Tj TJ ' " |
| ogColor | Colour: CS cs SC SCN sc scn G g RG rg K k |
| ogShading | Shading: sh |
| ogInlineImage | Inline images: BI ID EI |
| ogXObject | XObjects: Do |
| ogMarkedContent | Marked content: MP DP BMC BDC EMC |
| ogCompatibility | Compatibility sections: BX EX |
| ogType3 | Type 3 glyph metrics: d0 d1 |
Remarks
An operator token outside Table 51 parses to coUnknown, whose stored group is ogUnknown; searching for ogUnknown therefore finds the preserved unknown instructions.
Group boundaries follow the operator table, not the parser: W and W* are ogClipping even though they only take effect at the next painting operator.
See also
TPDFContentOperator, InstructionGroup, FindNextGroup, FindNextOp, TPDFContentProgram