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

coUnknownOrdinal 0: the token is not in Table 51, or the instruction carries no operator
coLineWidthw: line width
coLineCapJ: line cap style
coLineJoinj: line join style
coMiterLimitM: miter limit
coDashPatternd: dash array and dash phase
coRenderingIntentri: rendering intent name
coFlatnessi: flatness tolerance
coExtGStategs: named graphics state parameter dictionary
coSaveStateq: push the graphics state
coRestoreStateQ: pop the graphics state
coConcatMatrixcm: concatenate a matrix with the CTM
coMoveTom: begin a new subpath
coLineTol: append a straight segment
coCurveToc: append a cubic Bézier with two control points
coCurveToVv: cubic Bézier whose first control point is the current point
coCurveToYy: cubic Bézier whose second control point is the end point
coClosePathh: close the current subpath
coRectanglere: append a rectangle as a closed subpath
coStrokeS: stroke the path
coCloseStrokes: close the subpath, then stroke
coFillf: fill with the non-zero winding rule
coFillLegacyF: obsolete spelling of f
coFillEvenOddf*: fill with the even-odd rule
coFillStrokeB: fill, then stroke
coFillStrokeEvenOddB*: even-odd fill, then stroke
coCloseFillStrokeb: close the subpath, fill, then stroke
coCloseFillStrokeEvenOddb*: close, even-odd fill, then stroke
coNoPaintn: end the path without painting
coClipW: intersect the clipping path with the current path (non-zero rule)
coClipEvenOddW*: intersect the clipping path with the current path (even-odd rule)
coBeginTextBT: begin a text object
coEndTextET: end a text object
coCharSpacingTc: character spacing
coWordSpacingTw: word spacing
coHorizScalingTz: horizontal scaling
coLeadingTL: text leading
coFontAndSizeTf: font resource and size
coRenderModeTr: text rendering mode
coRiseTs: text rise
coTextMoveTd: move the text line origin
coTextMoveSetLeadingTD: move the line origin and set leading
coTextMatrixTm: set the text matrix
coNextLineT*: move to the next text line
coShowTextTj: show one string
coShowTextArrayTJ: 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
coStrokeColorSpaceCS: set the stroke colour space
coFillColorSpacecs: set the fill colour space
coStrokeColorSC: set the stroke colour components
coStrokeColorNSCN: set stroke colour components or a pattern name
coFillColorsc: set the fill colour components
coFillColorNscn: set fill colour components or a pattern name
coStrokeGrayG: set the stroke colour to device gray
coFillGrayg: set the fill colour to device gray
coStrokeRGBRG: set the stroke colour to device RGB
coFillRGBrg: set the fill colour to device RGB
coStrokeCMYKK: set the stroke colour to device CMYK
coFillCMYKk: set the fill colour to device CMYK
coShadingPaintsh: paint a shading
coBeginImageBI: start an inline image; the parser stores the complete BI..EI slice in RawInlineImage
coImageDataID: start of the inline image binary samples
coEndImageEI: end of an inline image
coXObjectDo: paint an XObject
coMarkedPointMP: mark a point with a tag
coMarkedPointPropsDP: mark a point with a tag and a property list
coBeginMarkedBMC: begin a marked-content sequence
coBeginMarkedPropsBDC: begin a marked-content sequence with a property list
coEndMarkedEMC: end a marked-content sequence
coBeginCompatBX: begin a compatibility section
coEndCompatEX: end a compatibility section
coType3Widthd0: Type 3 glyph width only
coType3WidthBBoxd1: 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