#[non_exhaustive]pub enum Op {
Show 75 variants
SaveState(),
RestoreState(),
Concat(Affine),
SetLineWidth(f32),
SetLineCap(LineCap),
SetLineJoin(LineJoin),
SetMiterLimit(f32),
SetDash(DashPattern),
SetRenderIntent(Name),
SetFlatness(f32),
SetExtGState(Name),
MoveTo(Point),
LineTo(Point),
CurveTo(Point, Point, Point),
CurveToV(Point, Point),
CurveToY(Point, Point),
ClosePath(),
Rectangle(f32, f32, f32, f32),
Stroke(),
CloseStroke(),
Fill(),
FillObsolete(),
FillEvenOdd(),
FillStroke(),
FillStrokeEvenOdd(),
CloseFillStroke(),
CloseFillStrokeEvenOdd(),
EndPath(),
Clip(),
ClipEvenOdd(),
BeginText(),
EndText(),
TextMove(f32, f32),
TextMoveSetLeading(f32, f32),
SetTextMatrix(Affine),
TextNextLine(),
SetLeading(f32),
SetTextRise(f32),
SetHorzScale(f32),
SetCharSpace(f32),
SetWordSpace(f32),
SetFont(Name, f32),
SetTextRenderMode(i64),
ShowText(PdfString),
NextLineShowText(PdfString),
SetSpacingShowText(f32, f32, PdfString),
ShowTextAdjusted(TextArray),
Type3Width(f32, f32),
Type3WidthBBox(f32, f32, f32, f32, f32, f32),
SetStrokeColorSpace(Name),
SetFillColorSpace(Name),
SetStrokeColor(Components),
SetFillColor(Components),
SetStrokeColorN(PatternComponents),
SetFillColorN(PatternComponents),
SetStrokeGray(f32),
SetFillGray(f32),
SetStrokeRgb(f32, f32, f32),
SetFillRgb(f32, f32, f32),
SetStrokeCmyk(f32, f32, f32, f32),
SetFillCmyk(f32, f32, f32, f32),
DoXObject(Name),
ShadeFill(Name),
BeginInlineImage(),
InlineImageData(),
EndInlineImage(),
BeginMarkedContent(Name),
BeginMarkedContentDict(Name, MarkProps),
EndMarkedContent(),
MarkPoint(Name),
MarkPointDict(Name, MarkProps),
BeginCompat(),
EndCompat(),
InlineImage(Box<InlineImage>),
Unknown(Box<[u8]>),
}Expand description
One content-stream operator with its operands already extracted.
Generated from the table in this module, which is the only place operator spellings appear.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SaveState()
q — push a copy of the graphics state.
RestoreState()
Q — pop the graphics state; a no-op on an empty stack.
Concat(Affine)
cm — pre-concatenate a matrix onto the CTM.
SetLineWidth(f32)
w — set the line width. Negative and zero widths are stored as-is.
SetLineCap(LineCap)
J — set the line cap.
SetLineJoin(LineJoin)
j — set the line join.
SetMiterLimit(f32)
M — set the miter limit.
SetDash(DashPattern)
d — set the dash pattern and phase.
SetRenderIntent(Name)
ri — set the rendering intent. PDFium discards it outright; only
the /RI ExtGState key is stored.
SetFlatness(f32)
i — set the flatness tolerance. Stored, never used.
SetExtGState(Name)
gs — apply a named /ExtGState dictionary.
MoveTo(Point)
m — begin a new subpath at a point.
LineTo(Point)
l — append a straight segment.
CurveTo(Point, Point, Point)
c — append a cubic Bézier with both control points given.
CurveToV(Point, Point)
v — append a cubic Bézier whose first control point is the current
point.
CurveToY(Point, Point)
y — append a cubic Bézier whose second control point is its
endpoint.
ClosePath()
h — close the current subpath.
Rectangle(f32, f32, f32, f32)
re — append a complete rectangle as a new subpath: x, y, width,
height, oldest first.
Stroke()
S — stroke the path.
CloseStroke()
s — close and stroke.
Fill()
f — fill with the nonzero winding rule.
FillObsolete()
F — the obsolete spelling of f, handled identically.
FillEvenOdd()
f* — fill with the even-odd rule.
FillStroke()
B — fill then stroke, nonzero winding.
FillStrokeEvenOdd()
B* — fill then stroke, even-odd.
CloseFillStroke()
b — close, fill and stroke, nonzero winding.
CloseFillStrokeEvenOdd()
b* — close, fill and stroke, even-odd. Unlike b, this appends the
closing segment unconditionally.
EndPath()
n — end the path without painting; only a pending clip survives.
Clip()
W — intersect the clip with the current path, nonzero winding.
ClipEvenOdd()
W* — intersect the clip with the current path, even-odd.
BeginText()
BT — begin a text object, resetting both text matrices.
EndText()
ET — end a text object, flushing any pending text clip.
TextMove(f32, f32)
Td — move to the start of the next line, offset from the current
line start.
TextMoveSetLeading(f32, f32)
TD — Td plus setting the leading to the negated y offset.
SetTextMatrix(Affine)
Tm — set the text matrix and the line matrix.
TextNextLine()
T* — move to the start of the next line.
SetLeading(f32)
TL — set the leading.
SetTextRise(f32)
Ts — set the text rise.
SetHorzScale(f32)
Tz — set the horizontal scale, stored as the percentage over 100.
SetCharSpace(f32)
Tc — set the character spacing.
SetWordSpace(f32)
Tw — set the word spacing.
SetFont(Name, f32)
Tf — set the font and size. The size is always taken; the font only
when the name resolves.
SetTextRenderMode(i64)
Tr — set the text rendering mode. Values outside 0..=7 leave the
mode unchanged, so the operand arrives raw.
ShowText(PdfString)
Tj — show a string.
NextLineShowText(PdfString)
' — move to the next line and show a string.
SetSpacingShowText(f32, f32, PdfString)
" — set word and character spacing, then '. The string is the
newest operand.
ShowTextAdjusted(TextArray)
TJ — show strings with individual position adjustments.
Type3Width(f32, f32)
d0 — declare a coloured Type 3 glyph’s advance.
Type3WidthBBox(f32, f32, f32, f32, f32, f32)
d1 — declare an uncoloured Type 3 glyph’s advance and bounding box,
oldest first.
SetStrokeColorSpace(Name)
CS — set the stroking colorspace, resetting the colour to its
default.
SetFillColorSpace(Name)
cs — set the non-stroking colorspace.
SetStrokeColor(Components)
SC — set stroking colour components, at most four.
SetFillColor(Components)
sc — set non-stroking colour components, at most four.
SetStrokeColorN(PatternComponents)
SCN — set stroking colour components, optionally naming a pattern.
SetFillColorN(PatternComponents)
scn — set non-stroking colour components, optionally naming a
pattern.
SetStrokeGray(f32)
G — set the stroking colour to a DeviceGray level.
SetFillGray(f32)
g — set the non-stroking colour to a DeviceGray level.
SetStrokeRgb(f32, f32, f32)
RG — set the stroking colour to a DeviceRGB triple.
SetFillRgb(f32, f32, f32)
rg — set the non-stroking colour to a DeviceRGB triple.
SetStrokeCmyk(f32, f32, f32, f32)
K — set the stroking colour to a DeviceCMYK quadruple.
SetFillCmyk(f32, f32, f32, f32)
k — set the non-stroking colour to a DeviceCMYK quadruple.
DoXObject(Name)
Do — paint a named form or image XObject.
ShadeFill(Name)
sh — paint a named shading across the clip region.
BeginInlineImage()
BI — begin an inline image. Reaching dispatch means the tokenizer
abandoned the image, so the operator itself does nothing.
InlineImageData()
ID — a stray ID outside a BI. A no-op.
EndInlineImage()
EI — a stray EI outside a BI. A no-op.
BeginMarkedContent(Name)
BMC — begin a marked-content sequence with no properties.
BeginMarkedContentDict(Name, MarkProps)
BDC — begin a marked-content sequence with a property list.
EndMarkedContent()
EMC — end a marked-content sequence; never pops past the sentinel.
MarkPoint(Name)
MP — a marked-content point with no properties. A no-op.
MarkPointDict(Name, MarkProps)
DP — a marked-content point with a property list. A no-op.
BeginCompat()
BX — begin a compatibility section. PDFium never registers this, so
it falls through as an unknown keyword and is ignored; we name it so
the enum is complete.
EndCompat()
EX — end a compatibility section. Ignored, like BX.
InlineImage(Box<InlineImage>)
An inline image, consumed whole by the tokenizer.
Unknown(Box<[u8]>)
A keyword that names no operator. PDFium drops it silently after clearing the operands; we keep the spelling so a diagnostic and a dump can name it.