The list of operations contains all operations as defined in the PDF Specification that are used in PDF.js, aside with the operations that are only defined by PDF.js. The first group of operations show the operator, operands and description as defined in the PDF Specification. In the second group I tried to describe the operations as good as possible.
(Copyright Adobe Systems Incorporated / Extracted from the PDF Specification: Figure 9 - Graphic objects)
setLineWidth
(w
)setLineCap
(J
)setLineJoin
(j
)setMiterLimit
(M
)setDash
(d
)setRenderingIntent
(ri
)setFlatness
(i
)setGState
(gs
)
stroke
(S
)closeStroke
(s
)fill
(f
/F
)eoFill
(f*
)fillStroke
(B
)eoFillStroke
(B*
)closeFillStroke
(b
)closeEOFillStroke
(b*
)endPath
(n
)
beginnText
(BT
)endText
(ET
)
setCharSpacing
(Tc
)setWordSpacing
(Tw
)setHScale
(Tz
)setLeading
(TL
)setFont
(Tf
)setTextRenderingMode
(Tr
)setTextRise
(Ts
)
moveText
(Td
)setLeadingMoveText
(TD
)setTextMatrix
(Tm
)nextLine
(T*
)
showText
(Tj
)showSpacedText
(TJ
)nextLineShowText
('
)nextLineSetSpacingShowText
("
)
setCharWidth
(d0
)setCharWidthAndBounds
(d1
)
setStrokeColorSpace
(CS
)setFillColorSpace
(cs
)setStrokeColor
(SC
)setStrokeColorN
(SCN
)setFillColor
(sc
)setFillColorN
(scn
)setStrokeGray
(G
)setFillGray
(g
)setStrokeRGBColor
(RG
)setFillRGBColor
(rg
)setStrokeCMYKColor
(K
)setFillCMYKColor
(k
)
shadingFill
(sh
)
beginInlineImage
(BI
)beginImageData
(ID
)endInlineImage
(EI
)
paintXObject
(Do
)
markPoint
(MP
)markPointProps
(DP
)beginMarkedContent
(BMC
)beginMarkedContentProps
(BDC
)endMarkedContent
(EMC
)
beginCompat
(BX
)endCompat
(EX
)
dependency
paintFormXObjectBegin
paintFormXObjectEnd
beginGroup
endGroup
beginAnnotations
endAnnotations
beginAnnotation
endAnnotation
paintJpegXObject
paintImageMaskXObject
paintImageMaskXObjectGroup
paintImageXObject
paintInlineImageXObject
paintInlineImageXObjectGroup
paintImageXObjectRepeat
paintImageMaskXObjectRepeat
paintSolidColorImageMask
constructPath
dependencies
:array
- list of dependency object ids
lineWidth
:number
Set the line width in the graphics state.
- PDF Specification / Table 57 – Graphics State Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2823
lineCap
:number
- either0
(butt),1
(round), or2
(square)
Set the line cap style in the graphics state.
- PDF Specification / Table 57 – Graphics State Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2824
- https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap
lineJoin
:number
- either0
(miter),1
(round), or2
(bevel)
Set the line join style in the graphics state.
- PDF Specification / Table 57 – Graphics State Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2825
- https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin
miterLimit
:number
Set the miter limit in the graphics state.
- PDF Specification / Table 57 – Graphics State Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2826
- https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/miterLimit
-
dashArray
:array
- An array of numbers which specify distances to alternately draw a line and a gap (in coordinate space units). If the number of elements in the array is odd, the elements of the array get copied and concatenated;see also: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
-
dashPhase
:number
- A float specifying the amount of the offset;see also: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset
Set the line dash pattern in the graphics state.
- PDF Specification / Table 57 – Graphics State Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2827
intent
: ?
Set the colour rendering intent in the graphics state.
- PDF Specification / Table 57 – Graphics State Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2828
flatness
:number
Set the flatness tolerance in the graphics state. flatness
is a number in the range 0
to 100
; a value of 0
shall specify the output device’s default flatness tolerance.
- PDF Specification / Table 57 – Graphics State Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2829
states
:array
- An array of key-value pairs where the first element of the pair is the key and the second element is the value. Keys may be any of the following:LW
(setLineWidth)LC
(setLineCap)LJ
(setLineJoin)ML
(setMiterLimit)D
(setDash)RI
(setRenderingIntent)FL
(setFlatness)Font
(setFont)CA
(stroke alpha)ca
(fill alpha)BM
(global composite operation)SMask
.
Set the specified parameters in the graphics state. dictName
shall be the name of a graphics state parameter dictionary in the ExtGState subdictionary of the current resource dictionary.
- PDF Specification / Table 57 – Graphics State Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2830
none
As defined in the PDF specification, the following properties are stored on the graphic stack:
- Stroke
- line width
- line cap style
- line join style
- miter limit
- line dash pattern
Saves the following properties:
- font
- font size
- font size scale
- font weight (only svg)
- font matrix
- text
- text matrix
- text matrix scale
- text horizontal scale
- text rendering mode
- text rise
- spacing
- character spacing
- word spacing
- color
- fill color
- stroke color
- alpha
- alpha is shape (only canvas)
- fill alpha
- stroke alpha
- line
- line width
- line join (only svg)
- line cap (only svg)
- leading ?
- pattern fill ?
- current point (x, y) (in user coordinates)
- start of text line (x, y) (in text coordinates)
- active s-mask
- resume s-mask context
- dash array (only svg)
- dash phase (only svg)
- dependencies (only svg)
- active clip url (only svg)
- clip group (only svg)
- mask id (only svg)
Save the current graphics state on the graphics state stack.
- PDF Specification / Table 57 – Graphics State Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2831
none
Restore the graphics state by removing the most recently saved state from the stack and making it the current state.
- PDF Specification / Table 57 – Graphics State Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2832
a
:number
- horizontal scalingb
:number
- horizontal skewingc
:number
- vertical skewingd
:number
- vertical scalinge
:number
- horizontal movingf
:number
- vertical moving
Modify the current transformation matrix (CTM) by concatenating the specified matrix. Although the operands specify a matrix, they shall be written as six separate numbers, not as an array.
- PDF Specification / Table 57 – Graphics State Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2833
x
:number
y
:number
Begin a new subpath by moving the current point to coordinates (x
, y
), omitting any connecting line segment. If the previous path construction operator in the current path was also m
, the new m
overrides it; no vestige of the previous m
operation remains in the path.
- PDF Specification / Table 59 – Path Construction Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2836
x
:number
y
:number
Append a straight line segment from the current point to the point (x
, y
). The new current point shall be (x
, y
).
- PDF Specification / Table 59 – Path Construction Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2837
x1
:number
y1
:number
x2
:number
y2
:number
x3
:number
y3
:number
Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3
, y3
), using (x1
, y1
) and (x2
, y2
) as the Bézier control points. The new current point shall be (x3
, y3
).
- PDF Specification / Table 59 – Path Construction Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2838
x2
:number
y2
:number
x3
:number
y3
:number
Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3
, y3
), using the current point and (x2
, y2
) as the Bézier control points. The new current point shall be (x3
, y3
).
- PDF Specification / Table 59 – Path Construction Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2839
x1
:number
y1
:number
x3
:number
y3
:number
Append a cubic Bézier curve to the current path. The curve shall extend from the current point to the point (x3
, y3
), using (x1
, y1
) and (x3
, y3
) as the Bézier control points. The new current point shall be (x3
, y3
).
- PDF Specification / Table 59 – Path Construction Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2840
none
Close the current subpath by appending a straight line segment from the current point to the starting point of the
subpath. If the current subpath is already closed, h
shall do nothing.
This operator terminates the current subpath. Appending another segment to the current path shall begin a new subpath, even if the new segment begins at the endpoint reached by the h
operation.
- PDF Specification / Table 59 – Path Construction Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2841
x
:number
y
:number
width
:number
height
:number
Append a rectangle to the current path as a complete subpath, with lower-left corner (x
, y
) and dimensions width
and height
in user space. The operation
x y width height re
is equivalent to
x y m
(x + width) y l
(x + width) (y + height) l
x (y + height) l
h
- PDF Specification / Table 59 – Path Construction Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2842
none
Stroke the path.
- PDF Specification / Table 60 – Path-Painting Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2843
none
Close and stroke the path. This operator shall have the same effect as the sequence h S
.
- PDF Specification / Table 60 – Path-Painting Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2844
none
Fill the path, using the nonzero winding number rule to determine the region to fill. Any subpaths that are open shall be implicitly closed before being filled.
- PDF Specification / Table 60 – Path-Painting Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2845-L2846
none
Fill the path, using the even-odd rule to determine the region to fill.
- PDF Specification / Table 60 – Path-Painting Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2847
none
Fill and then stroke the path, using the nonzero winding number rule to determine the region to fill. This operator shall produce the same result as constructing two identical path objects, painting the first with f
and the second with S
.
- PDF Specification / Table 60 – Path-Painting Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2848
none
Fill and then stroke the path, using the even-odd rule to determine the region to fill. This operator shall produce the same result as B
, except that the path is filled as if with f*
instead of f
.
- PDF Specification / Table 60 – Path-Painting Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2849
none
Close, fill, and then stroke the path, using the nonzero winding number rule to determine the region to fill. This operator shall have the same effect as the sequence h B
.
- PDF Specification / Table 60 – Path-Painting Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2850
none
Close, fill, and then stroke the path, using the even-odd rule to determine the region to fill. This operator shall have the same effect as the sequence h B*
.
- PDF Specification / Table 60 – Path-Painting Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2851
none
End the path object without filling or stroking it. This operator shall be a path-painting no-op, used primarily for the side effect of changing the current clipping path.
- PDF Specification / Table 60 – Path-Painting Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2852
none
Modify the current clipping path by intersecting it with the current path, using the nonzero winding number rule to determine which regions lie inside the clipping path.
- PDF Specification / Table 61 – Clipping Path Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2855
none
Modify the current clipping path by intersecting it with the current path, using the even-odd rule to determine which regions lie inside the clipping path.
- PDF Specification / Table 61 – Clipping Path Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2856
none
Begin a text object, initializing the text matrix and the text line matrix to the identity matrix. Text objects shall not be nested; a second BT
shall not appear before an ET
(endText
).
- PDF Specification / Table 107 – Text object operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2859
none
End a text object, discarding the text matrix.
- PDF Specification / Table 107 – Text object operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2860
charSpace
:number
Set the character spacing to charSpace
, which shall be a number expressed in unscaled text space units. Character spacing shall be used by the Tj
(showText
), TJ
(showSpacedText
), and '
(nextLineShowText
) operators. Initial value: 0
.
- PDF Specification / Table 105 – Text state operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2861
wordSpace
:number
Set the word spacing to wordSpace
, which shall be a number expressed in unscaled text space units. Word spacing shall be used by the Tj
(showText
), TJ
(showSpacedText
), and '
(nextLineShowText
) operators. Initial value: 0
.
- PDF Specification / Table 105 – Text state operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2862
scale
:number
Set the horizontal scaling to (scale
÷ 100). scale
shall be a number specifying the percentage of the normal width. Initial value: 100
(normal width).
- PDF Specification / Table 105 – Text state operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2863
leading
:number
Set the text leading to leading
, which shall be a number expressed in unscaled text space units. Text leading shall be used only by the T*
(nextLine
), '
(nextLineShowText
), and "
(nextLineSetSpacingShowText
) operators. Initial value: 0
.
- PDF Specification / Table 105 – Text state operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2864
font
:string
size
:number
Set the text font to font
and the text font size to size
. font
shall be the name of a font resource in the Font subdictionary of the current resource dictionary; size
shall be a number representing a scale factor. There is no initial value for either font
or size
; they shall be specified explicitly by using Tf
before any text is shown.
- PDF Specification / Table 105 – Text state operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2865
render
: ?
Set the text rendering mode to render
, which shall be an integer. Initial value: 0
.
- PDF Specification / Table 105 – Text state operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2866
rise
: ?
Set the text rise to rise
, which shall be a number expressed in unscaled text space units. Initial value: 0
.
- PDF Specification / Table 105 – Text state operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2868
tx
:number
ty
:number
Move to the start of the next line, offset from the start of the current line by (tx
, ty
). tx
and ty
shall denote numbers expressed in unscaled text space units. More precisely, this operator shall perform these assignments:
⎡ 1 0 0 ⎤
Tm = Tlm = ⎢ 0 1 0 ⎥ ⨯ Tlm
⎣ tx ty 1 ⎦
Tm = text matrix
Tlm = text line matrix
- PDF Specification / Table 108 – Text-positioning operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2869
tx
:number
ty
:number
Move to the start of the next line, offset from the start of the current line by (tx
, ty
). As a side effect, this operator shall set the leading parameter in the text state. This operator shall have the same effect as this code:
−ty TL
tx ty Td
- PDF Specification / Table 108 – Text-positioning operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2870
a
:number
- horizontal scalingb
:number
- horizontal skewingc
:number
- vertical skewingd
:number
- vertical scalinge
:number
- horizontal movingf
:number
- vertical moving
Set the text matrix, Tm, and the text line matrix, Tlm:
⎡ a d 0 ⎤
Tm = Tlm = ⎢ b e 0 ⎥
⎣ c f 1 ⎦
Tm = text matrix
Tlm = text line matrix
The operands shall all be numbers, and the initial value for Tm and Tlm shall be the identity matrix, [ 1 0 0 1 0 0 ]
. Although the operands specify a matrix, they shall be passed to Tm as six separate numbers, not as an array.
The matrix specified by the operands shall not be concatenated onto the current text matrix, but shall replace it.
- PDF Specification / Table 108 – Text-positioning operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2871
none
Move to the start of the next line. This operator has the same effect as the code
0 -Tl Td
where Tl
denotes the current leading parameter in the text state. The negative of Tl
is used here because Tl
is the text leading expressed as a positive number. Going to the next line entails decreasing the y coordinate.
- PDF Specification / Table 108 – Text-positioning operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2872
Operands differ between the PDF specification and the implementation in PDF.js.
string
:string
(PDF Specification)glyphs
:array
(implementation in PDF.js)
Show a text string.
- PDF Specification / Table 109 – Text-showing operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2873
array
: ?
Show one or more text strings, allowing individual glyph positioning. Each element of array
shall be either a string or a number. If the element is a string, this operator shall show the string. If it is a number, the operator shall adjust the text position by that amount; that is, it shall translate the text matrix, Tm. The number shall be expressed in thousandths of a unit of text space. This amount shall be subtracted from the current horizontal or vertical coordinate, depending on the writing mode. In the default coordinate system, a positive adjustment has the effect of moving the next glyph painted either to the left or down by the given amount.
- PDF Specification / Table 109 – Text-showing operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2874
Operands differ between the PDF specification and the implementation in PDF.js.
string
:string
(PDF Specification)glyphs
:array
(implementation in PDF.js)
Move to the next line and show a text string. This operator shall have the same effect as the code
T*
string Tj
- PDF Specification / Table 109 – Text-showing operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2875
Operands differ between the PDF specification and the implementation in PDF.js.
aw
:number
(same)ac
:number
(same)string
:string
(PDF Specification)glyphs
:array
(implementation in PDF.js)
Move to the next line and show a text string, using aw
as the word spacing and ac
as the character spacing (setting the corresponding parameters in the text state). aw
and ac
shall be numbers expressed in unscaled text space units. This operator shall have the same effect as this code:
aw Tw
ac Tc
string '
- PDF Specification / Table 109 – Text-showing operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2876-L2877
wx
:number
wy
:number
Set width information for the glyph and declare that the glyph description specifies both its shape and its colour.
wx
denotes the horizontal displacement in the glyph coordinate system; it shall be consistent with the corresponding width in the font’s Widths array. wy
shall be 0
.
This operator shall only be permitted in a content stream appearing in a Type 3 font’s CharProcs dictionary. It is typically used only if the glyph description executes operators to set the colour explicitly.
- PDF Specification / Table 113 – Type 3 font operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2880
wx
:number
wy
:number
llx
: ?lly
: ?urx
: ?ury
: ?
Set width and bounding box information for the glyph and declare that the glyph description specifies only shape, not colour.
wx
denotes the horizontal displacement in the glyph coordinate system; it shall be consistent with the corresponding width in the font’s Widths array. wy
shall be 0
.
llx
and lly
denote the coordinates of the lower-left corner, and urx
and ury
denote the upper-right corner, of the glyph bounding box.
The glyph bounding box is the smallest rectangle, oriented with the axes of the glyph coordinate system, that completely encloses all marks placed on the page as a result of executing the glyph’s description. The declared bounding box shall be correct—in other words, sufficiently large to enclose the entire glyph. If any marks fall outside this bounding box, the result is unpredictable.
A glyph description that begins with the d1
operator should not execute any operators that set the colour (or other colour-related parameters) in the graphics state; any use of such operators shall be ignored. The glyph description is executed solely to determine the glyph’s shape. Its colour shall be determined by the graphics state in effect each time this glyph is painted by a text-showing operator. For the same reason, the glyph description shall not include an image; however, an image mask is acceptable, since it merely defines a region of the page to be painted with the current colour.
This operator shall be used only in a content stream appearing in a Type 3 font’s CharProcs dictionary.
- PDF Specification / Table 113 – Type 3 font operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2881
name
:string
Set the current colour space to use for stroking operations. The operand name
shall be a name object. If the colour space is one that can be specified by a name and no additional parameters (DeviceGray, DeviceRGB, DeviceCMYK, and certain cases of Pattern), the name may be specified directly. Otherwise, it shall be a name defined in the ColorSpace subdictionary of the current resource dictionary; the associated value shall be an array describing the colour space.
The names DeviceGray, DeviceRGB, DeviceCMYK, and Pattern always identify the corresponding colour spaces directly; they never refer to resources in the ColorSpace subdictionary.
The CS
operator shall also set the current stroking colour to its initial value, which depends on the colour space:
- In a DeviceGray, DeviceRGB, CalGray, or CalRGB colour space, the initial colour shall have all components equal to
0.0
. - In a DeviceCMYK colour space, the initial colour shall be
[ 0.0 0.0 0.0 1.0 ]
. - In a Lab or ICCBased colour space, the initial colour shall have all components equal to
0.0
unless that falls outside the intervals specified by the space’s Range entry, in which case the nearest valid value shall be substituted. - In an Indexed colour space, the initial colour value shall be
0
. - In a Separation or DeviceN colour space, the initial tint value shall be
1.0
for all colorants. - In a Pattern colour space, the initial colour shall be a pattern object that causes nothing to be painted.
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2885
name
:string
Same as CS
(setStrokeColorSpace
) but used for nonstroking operations.
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2886
For gray color spaces (DeviceGray, CalGray or Indexed):
level
:number
For RGB color spaces (DeviceRGB, CalRGB or Lab):
r
:number
g
:number
b
:number
For CMYK color spaces (DeviceCMYK):
c
:number
m
:number
y
:number
k
:number
Set the colour to use for stroking operations in a device, CIE-based (other than ICCBased), or Indexed colour space. The number of operands required and their interpretation depends on the current stroking colour space:
- For DeviceGray, CalGray, and Indexed colour spaces, one operand shall be required (
n
=1
). - For DeviceRGB, CalRGB, and Lab colour spaces, three operands shall be required (
n
=3
). - For DeviceCMYK four operands shall be required (
n
=4
).
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2887
c1
...cn
(n
≤ 32) orc1
...cn
(n
≤ 32)name
Same as SC
(setStrokeColor
) but also supports Pattern, Separation, DeviceN and ICCBased colour spaces.
If the current stroking colour space is a Separation, DeviceN, or ICCBased colour space, the operands c1
... cn
shall be numbers. The number of operands and their interpretation depends on the colour space.
If the current stroking colour space is a Pattern colour space, name
shall be the name of an entry in the Pattern subdictionary of the current resource dictionary. For an uncoloured tiling pattern (PatternType = 1
and PaintType = 2
), c1
... cn
shall be component values specifying a colour in the pattern’s underlying colour space. For other types of patterns, these operands shall not be specified.
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2888
For gray color spaces (DeviceGray, CalGray or Indexed):
level
:number
For RGB color spaces (DeviceRGB, CalRGB or Lab):
r
:number
g
:number
b
:number
For CMYK color spaces (DeviceCMYK):
c
:number
m
:number
y
:number
k
:number
Same as SC
(setStrokeColor
) but used for nonstroking operations.
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2889
c1
...cn
(n
≤ 32) orc1
...cn
(n
≤ 32)name
Same as SCN
(setStrokeColorN
) but used for nonstroking operations.
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2890
gray
:number
- value between0.0
(black) and1.0
(white)
Set the stroking colour space to DeviceGray (or the DefaultGray colour space) and set the gray level to use for stroking operations. gray
shall be a number between 0.0
(black) and 1.0
(white).
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2891
gray
:number
- value between0.0
(black) and1.0
(white).
Same as G
(setStrokeGray
) but used for nonstroking operations.
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2892
r
:number
- value between0.0
(minimum intensity) and1.0
(maximum intensity)g
:number
- value between0.0
(minimum intensity) and1.0
(maximum intensity)b
:number
- value between0.0
(minimum intensity) and1.0
(maximum intensity)
Set the stroking colour space to DeviceRGB (or the DefaultRGB colour space) and set the colour to use for stroking operations. Each operand shall be a number between 0.0
(minimum intensity) and 1.0
(maximum intensity).
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2893
r
:number
- value between0.0
(minimum intensity) and1.0
(maximum intensity)g
:number
- value between0.0
(minimum intensity) and1.0
(maximum intensity)b
:number
- value between0.0
(minimum intensity) and1.0
(maximum intensity)
Same as RG
(setStrokeRGBColor
) but used for nonstroking operations.
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2894
c
:number
- value between0.0
(zero concentration) and1.0
(maximum concentration)m
:number
- value between0.0
(zero concentration) and1.0
(maximum concentration)y
:number
- value between0.0
(zero concentration) and1.0
(maximum concentration)k
:number
- value between0.0
(zero concentration) and1.0
(maximum concentration)
Set the stroking colour space to DeviceCMYK (or the DefaultCMYK colour space) and set the colour to use for stroking operations. Each operand shall be a number between 0.0
(zero concentration) and 1.0
(maximum concentration). The behaviour of this operator is affected by the overprint mode.
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2895
c
:number
- value between0.0
(zero concentration) and1.0
(maximum concentration)m
:number
- value between0.0
(zero concentration) and1.0
(maximum concentration)y
:number
- value between0.0
(zero concentration) and1.0
(maximum concentration)k
:number
- value between0.0
(zero concentration) and1.0
(maximum concentration)
Same as K
(setStrokeCMYKColor
) but used for nonstroking operations.
- PDF Specification / Table 74 – Colour Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2896
name
:string
Paint the shape and colour shading described by a shading dictionary, subject to the current clipping path. The current colour in the graphics state is neither used nor altered. The effect is different from that of painting a path using a shading pattern as the current colour.
name
is the name of a shading dictionary resource in the Shading subdictionary of the current resource dictionary. All coordinates in the shading dictionary are interpreted relative to the current user space. (By
contrast, when a shading dictionary is used in a type 2 pattern, the coordinates are expressed in pattern space.) All colours are interpreted in the colour space identified by the shading dictionary’s ColorSpace entry. The Background entry, if present, is ignored.
This operator should be applied only to bounded or geometrically defined shadings. If applied to an unbounded shading, it paints the shading’s gradient fill across the entire clipping region, which may be time-consuming.
- PDF Specification / Table 77 – Shading Operator
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2899
none
Begin an inline image object.
- PDF Specification / Table 92 – Inline Image Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2902
none
Begin the image data for an inline image object.
- PDF Specification / Table 92 – Inline Image Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2903
none
End an inline image object.
- PDF Specification / Table 92 – Inline Image Operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2904
name
: ?
Paint the specified XObject. The operand name
shall appear as a key in the XObject subdictionary of the current resource dictionary. The associated value shall be a stream whose Type entry, if present, is XObject. The effect of Do
depends on the value of the XObject’s Subtype entry, which may be Image, Form, or PS (PostScript XObject).
- PDF Specification / Table 87 – XObject Operator
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2907
tag
: ?
Designate a marked-content point. tag
shall be a name object indicating the role or significance of the point.
- PDF Specification / Table 320 – Marked-content operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2908
tag
: ?properties
: ?
Designate a marked-content point with an associated property list. tag
shall be a name object indicating the role or significance of the point. properties
shall be either an inline dictionary containing the property list or a name object associated with it in the Properties subdictionary of the current resource dictionary.
- PDF Specification / Table 320 – Marked-content operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2909
tag
: ?
Begin a marked-content sequence terminated by a balancing EMC
(endMarkedContent
) operator. tag
shall be a name object indicating the role or significance of the sequence.
- PDF Specification / Table 320 – Marked-content operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2910
tag
: ?properties
: ?
Begin a marked-content sequence with an associated property list, terminated by a balancing EMC
(endMarkedContent
) operator. tag
shall be a name object indicating the role or significance of the sequence. properties
shall be either an inline dictionary containing the property list or a name object associated with it in the Properties subdictionary of the current resource dictionary.
- PDF Specification / Table 320 – Marked-content operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2911-L2912
none
End a marked-content sequence begun by a BMC
(beginMarkedContent
) or BDC
(beginMarkedContentProps
) operator.
- PDF Specification / Table 320 – Marked-content operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2913
none
Begin a compatibility section. Unrecognized operators (along with their operands) shall be ignored without error until the balancing EX
(endCompat
) operator is encountered.
- PDF Specification / Table 32 – Compatibility operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2916
none
End a compatibility section begun by a balancing BX
(beginCompat
) operator. Ignore any unrecognized operands and operators from previous matching BX
onward.
- PDF Specification / Table 32 – Compatibility operators
- https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L2917
matrix
: ?bbox
: ?
https://github.com/mozilla/pdf.js/.../src/core/evaluator.js#L331
none
groupOptions
:object
matrix
: ?bbox
: ?smask
: ?isolated
:boolean
(default value:false
)knockout
:boolean
(default value:false
)
groupOptions
:object
matrix
: ?bbox
: ?smask
: ?isolated
:boolean
(default value:false
)knockout
:boolean
(default value:false
)
none
none
rect
: ?transform
: ?matrix
: ?
none
objId
: ?w
:number
h
:number
imgData
: ?
images
: ?
objId
: ?w
:number
h
:number
imgData
: ?
imgData
: ?map
: ?
objId
: ?scaleX
:number
scaleY
:number
positions
: ?
imgData
: ?scaleX
:number
scaleY
:number
positions
: ?
none
ops
:array
- a list of operation indexes (can be any ofmoveTo
(13
),lineTo
(14
),curveTo
(15
),curveTo2
(16
),curveTo3
(17
,closePath
(18
), orrectangle
(19
))args
:array
- a list of associated arguments for the operations defined inops
Represents a collection of path construction operations. Is there because of speed optimization so paths can be drawn in a batch.
{
"ops": [ 19, 13, 14 ],
"args": [ 0, 0, 5, 6, 6, 0, 4, 3 ],
}
This would draw a rectangle (19
) from the point (0
, 0
) with a width of 5
and a height of 6
, than move the cursor (13
) to the point (6
, 0
) and afterwards draw a line (14
) from this point to the point (4
, 3
):
rectangle
: [0
,0
,5
,6
]moveTo
: [6
,0
]lineTo
: [4
,3
]