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

ogUnknownNot a Table 51 operator; also the result of InstructionGroup for an out-of-range index
ogGeneralGSGeneral graphics state: w J j M d ri i gs
ogSpecialGSSpecial graphics state: q Q cm
ogPathConstructionPath construction: m l c v y h re
ogPathPaintingPath painting: S s f F f* B B* b b* n
ogClippingClipping: W W*
ogTextObjectText objects: BT ET
ogTextStateText state: Tc Tw Tz TL Tf Tr Ts
ogTextPositioningText positioning: Td TD Tm T*
ogTextShowingText showing: Tj TJ ' "
ogColorColour: CS cs SC SCN sc scn G g RG rg K k
ogShadingShading: sh
ogInlineImageInline images: BI ID EI
ogXObjectXObjects: Do
ogMarkedContentMarked content: MP DP BMC BDC EMC
ogCompatibilityCompatibility sections: BX EX
ogType3Type 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