-
clear: The
clearoperator removes all elements from the operand stack. Example:1 2 3 clear % Stack becomes empty -
cleardictstack: The
cleardictstackoperator removes all dictionaries from the dictionary stack. Example:cleardictstack % Clears all dictionaries from the stack -
cleartomark: The
cleartomarkoperator 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
clipoperator sets the current clipping path to the current path. Example:clip % Sets the clipping path to the current path -
clippath: The
clippathoperator 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
closefileoperator closes a file that was opened for reading or writing. Example:myFile closefile % Closes the file 'myFile' -
closepath: The
closepathoperator 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
colorimageoperator 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
concatoperator 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
concatmatrixoperator 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
conditionoperator executes a procedure based on a condition. Example:true { (Condition is true) print } condition % Prints "Condition is true" -
configurationerror: The
configurationerroroperator signals a configuration error. Example:configurationerror % Signals a configuration error -
copy: The
copyoperator duplicates the topnelements on the operand stack. Example:1 2 3 3 copy % Stack becomes [1 2 3 1 2 3] -
copypage: The
copypageoperator copies the entire visible page to another page. Example:copypage % Copies the current page -
cos: The
cosoperator calculates the cosine of an angle. Example:45 cos % Result: 0.7071 (the cosine of 45 degrees) -
count: The
countoperator 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
countdictstackoperator returns the number of dictionaries on the dictionary stack. Example:countdictstack % Returns the number of dictionaries on the stack -
countexecstack: The
countexecstackoperator returns the number of procedures on the execution stack. Example:countexecstack % Returns the number of procedures on the execution stack -
counttomark: The
counttomarkoperator 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
cshowoperator 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
curvetooperator 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
cvioperator 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
cvlitoperator 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
cvnoperator converts a number to a name. Example:
42 cvn % Result: /42 (converts the number 42 to the name /42)
- cvr: The
cvroperator 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
cvrsoperator converts a number to a string. Example:
42 cvrs % Result: (42) (converts the number 42 to the string "(42)")
- cvs: The
cvsoperator converts any type of operand to a string. Example:
(Hello) cvs % Result: (Hello) (converts the string "Hello" to itself)
- cvx: The
cvxoperator 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