TPDFContentOperator
Data types, content stream editing
Description
TPDFContentOperator enumerates the content stream operators of ISO 32000-1 Table 51: 73 tokens plus coUnknown, in table order. Every instruction of a parsed TPDFContentProgram stores one value in its Op field, and a token outside the table is still preserved through a parse/emit round trip in OpName rather than rejected.
The public constant array PDFContentOpInfo maps each value to the operator Name (the token exactly as it appears in the stream, for example 're' or 'f*') and to its Table 50 grouping TPDFOpGroup. ContentOperatorFromName performs the reverse lookup and is case-sensitive, so w/W and f/F never collide.
Path objects report their operators through this enum as well: LiftPath puts the painting operator in TPDFPath.PaintOp and a preceding W or W* in ClipOp.
Syntax
Delphi
TPDFContentOperator = (coUnknown,
coLineWidth, coLineCap, coLineJoin, coMiterLimit, coDashPattern, coRenderingIntent, coFlatness, coExtGState,
coSaveState, coRestoreState, coConcatMatrix,
coMoveTo, coLineTo, coCurveTo, coCurveToV, coCurveToY, coClosePath, coRectangle,
coStroke, coCloseStroke, coFill, coFillLegacy, coFillEvenOdd, coFillStroke, coFillStrokeEvenOdd, coCloseFillStroke, coCloseFillStrokeEvenOdd, coNoPaint,
coClip, coClipEvenOdd,
coBeginText, coEndText,
coCharSpacing, coWordSpacing, coHorizScaling, coLeading, coFontAndSize, coRenderMode, coRise,
coTextMove, coTextMoveSetLeading, coTextMatrix, coNextLine,
coShowText, coShowTextArray, coNextLineShow, coNextLineSpacedShow,
coStrokeColorSpace, coFillColorSpace, coStrokeColor, coStrokeColorN, coFillColor, coFillColorN, coStrokeGray, coFillGray, coStrokeRGB, coFillRGB,
coStrokeCMYK, coFillCMYK,
coShadingPaint,
coBeginImage, coImageData, coEndImage,
coXObject,
coMarkedPoint, coMarkedPointProps, coBeginMarked, coBeginMarkedProps, coEndMarked,
coBeginCompat, coEndCompat,
coType3Width, coType3WidthBBox);Values
| coUnknown | Ordinal 0: the token is not in Table 51, or the instruction carries no operator |
|---|---|
| coLineWidth | w: line width |
| coLineCap | J: line cap style |
| coLineJoin | j: line join style |
| coMiterLimit | M: miter limit |
| coDashPattern | d: dash array and dash phase |
| coRenderingIntent | ri: rendering intent name |
| coFlatness | i: flatness tolerance |
| coExtGState | gs: named graphics state parameter dictionary |
| coSaveState | q: push the graphics state |
| coRestoreState | Q: pop the graphics state |
| coConcatMatrix | cm: concatenate a matrix with the CTM |
| coMoveTo | m: begin a new subpath |
| coLineTo | l: append a straight segment |
| coCurveTo | c: append a cubic Bézier with two control points |
| coCurveToV | v: cubic Bézier whose first control point is the current point |
| coCurveToY | y: cubic Bézier whose second control point is the end point |
| coClosePath | h: close the current subpath |
| coRectangle | re: append a rectangle as a closed subpath |
| coStroke | S: stroke the path |
| coCloseStroke | s: close the subpath, then stroke |
| coFill | f: fill with the non-zero winding rule |
| coFillLegacy | F: obsolete spelling of f |
| coFillEvenOdd | f*: fill with the even-odd rule |
| coFillStroke | B: fill, then stroke |
| coFillStrokeEvenOdd | B*: even-odd fill, then stroke |
| coCloseFillStroke | b: close the subpath, fill, then stroke |
| coCloseFillStrokeEvenOdd | b*: close, even-odd fill, then stroke |
| coNoPaint | n: end the path without painting |
| coClip | W: intersect the clipping path with the current path (non-zero rule) |
| coClipEvenOdd | W*: intersect the clipping path with the current path (even-odd rule) |
| coBeginText | BT: begin a text object |
| coEndText | ET: end a text object |
| coCharSpacing | Tc: character spacing |
| coWordSpacing | Tw: word spacing |
| coHorizScaling | Tz: horizontal scaling |
| coLeading | TL: text leading |
| coFontAndSize | Tf: font resource and size |
| coRenderMode | Tr: text rendering mode |
| coRise | Ts: text rise |
| coTextMove | Td: move the text line origin |
| coTextMoveSetLeading | TD: move the line origin and set leading |
| coTextMatrix | Tm: set the text matrix |
| coNextLine | T*: move to the next text line |
| coShowText | Tj: show one string |
| coShowTextArray | TJ: show an array of strings and kerning adjustments |
| coNextLineShow | ': move to the next line and show one string |
| coNextLineSpacedShow | ": set word and character spacing, move to the next line, show one string |
| coStrokeColorSpace | CS: set the stroke colour space |
| coFillColorSpace | cs: set the fill colour space |
| coStrokeColor | SC: set the stroke colour components |
| coStrokeColorN | SCN: set stroke colour components or a pattern name |
| coFillColor | sc: set the fill colour components |
| coFillColorN | scn: set fill colour components or a pattern name |
| coStrokeGray | G: set the stroke colour to device grey |
| coFillGray | g: set the fill colour to device grey |
| coStrokeRGB | RG: set the stroke colour to device RGB |
| coFillRGB | rg: set the fill colour to device RGB |
| coStrokeCMYK | K: set the stroke colour to device CMYK |
| coFillCMYK | k: set the fill colour to device CMYK |
| coShadingPaint | sh: paint a shading |
| coBeginImage | BI: start an inline image; the parser stores the complete BI..EI slice in RawInlineImage |
| coImageData | ID: start of the inline image binary samples |
| coEndImage | EI: end of an inline image |
| coXObject | Do: paint an XObject |
| coMarkedPoint | MP: mark a point with a tag |
| coMarkedPointProps | DP: mark a point with a tag and a property list |
| coBeginMarked | BMC: begin a marked-content sequence |
| coBeginMarkedProps | BDC: begin a marked-content sequence with a property list |
| coEndMarked | EMC: end a marked-content sequence |
| coBeginCompat | BX: begin a compatibility section |
| coEndCompat | EX: end a compatibility section |
| coType3Width | d0: Type 3 glyph width only |
| coType3WidthBBox | d1: Type 3 glyph width and bounding box |
Remarks
Parse captures a complete BI..EI inline image as a single coBeginImage instruction, so coImageData and coEndImage never appear in a parsed program even though they are valid tokens.
coFillLegacy (F) parses to its own value and is emitted unchanged, so an edit that rewrites f does not silently turn an F into something else.
See also
TPDFOpGroup, TPDFContentInstruction, TPDFContentProgram, InstructionGroup, FindNextOp, FindNextGroup