-
clear: The
clear
operator removes all elements from the operand stack. Example:1 2 3 clear % Stack becomes empty
-
cleardictstack: The
cleardictstack
operator removes all dictionaries from the dictionary stack. Example:cleardictstack % Clears all dictionaries from the stack
-
cleartomark: The
cleartomark
operator removes all elements from the operand stack up to the nearest mark. Example:1 2 mark 3 4 cleartomark % Stack becomes [3 4]
-
clip: The
clip
operator sets the current clipping path to the current path. Example:clip % Sets the clipping path to the current path
-
clippath: The
clippath
operator intersects the current clipping path with the current path, resulting in the new clipping path. Example:clippath % Intersects the current clipping path with the current path
-
closefile: The
closefile
operator closes a file that was opened for reading or writing. Example:myFile closefile % Closes the file 'myFile'
-
closepath: The
closepath
operator adds a line segment from the current point to the starting point of the current subpath, effectively closing the path. Example:closepath % Closes the current path
-
colorimage: The
colorimage
operator defines a color image with the specified width, height, number of color components, and image data. Example:100 100 3 [255 0 0 0 255 0 0 0 255] colorimage % Creates a 100x100 RGB image with a red diagonal line
-
concat: The
concat
operator concatenates the current transformation matrix with the specified matrix. Example:[1 0 0 1 100 100] concat % Concatenates the current matrix with a translation by (100, 100)
-
concatmatrix: The
concatmatrix
operator replaces the current transformation matrix with the specified matrix. Example:1 0 0 1 0 0 concatmatrix % Resets the current matrix to the identity matrix
-
condition: The
condition
operator executes a procedure based on a condition. Example:true { (Condition is true) print } condition % Prints "Condition is true"
-
configurationerror: The
configurationerror
operator signals a configuration error. Example:configurationerror % Signals a configuration error
-
copy: The
copy
operator duplicates the topn
elements on the operand stack. Example:1 2 3 3 copy % Stack becomes [1 2 3 1 2 3]
-
copypage: The
copypage
operator copies the entire visible page to another page. Example:copypage % Copies the current page
-
cos: The
cos
operator calculates the cosine of an angle. Example:45 cos % Result: 0.7071 (the cosine of 45 degrees)
-
count: The
count
operator returns the number of elements on the operand stack. Example:1 2 3 count % Result: 3 (because there are three elements on the stack)
-
countdictstack: The
countdictstack
operator returns the number of dictionaries on the dictionary stack. Example:countdictstack % Returns the number of dictionaries on the stack
-
countexecstack: The
countexecstack
operator returns the number of procedures on the execution stack. Example:countexecstack % Returns the number of procedures on the execution stack
-
counttomark: The
counttomark
operator returns the number of elements between the mark and the top of the stack. Example:1 2 mark 3 4 5 counttomark % Result: 3 (because there are three elements between the mark and the top of the stack)
-
cshow: The
cshow
operator shows text using a font and character spacing specified in the graphics state. Example:(Hello, world!) cshow % Displays the text "Hello, world!" on the page
-
curveto: The
curveto
operator adds a cubic Bézier curve to the current path. It requires six parameters specifying the control points of the curve. Example:
100 100 200 200 300 100 curveto % Adds a cubic Bézier curve to the current path
- cvi: The
cvi
operator converts a number to an integer by truncating any fractional part. Example:
3.14 cvi % Result: 3 (converts 3.14 to an integer)
- cvlit: The
cvlit
operator converts an operand to a literal. It's typically used to prevent an operand from being executed as a procedure. Example:
/myProc { (This is a procedure) } def
myProc cvlit % Converts myProc to a literal
- cvn: The
cvn
operator converts a number to a name. Example:
42 cvn % Result: /42 (converts the number 42 to the name /42)
- cvr: The
cvr
operator converts a number to a real number (floating-point). Example:
42 cvr % Result: 42.0 (converts the integer 42 to a real number)
- cvrs: The
cvrs
operator converts a number to a string. Example:
42 cvrs % Result: (42) (converts the number 42 to the string "(42)")
- cvs: The
cvs
operator converts any type of operand to a string. Example:
(Hello) cvs % Result: (Hello) (converts the string "Hello" to itself)
- cvx: The
cvx
operator converts any type of operand to an executable. It's typically used to convert a name to a procedure. Example:
/myProc { (This is a procedure) } def
/myName cvx % Converts myName to an executable