Postscript Operators 'c'



cachestatus - cachestatus bsize bmax msize mmax csize cmax blimit

returns measurements of several aspects of the font cache .
cachestatus reports the current consumption and limit for each of three font cache resources: bytes of bitmap storage (bsize and bmax), font/matrix combinations (msize and mmax), and total number of cached characters (csize and cmax). It also reports the limit on the number of bytes occupied by a single cached character (blimit). Characters whose bitmaps are larger than this are not cached.

ERRORS: stackoverflow

SEE ALSO: setcachelimit, setsystemparams

Troubleshooting index Postscript Index


ceiling num1 ceiling num2

returns the least integer value greater than or equal to num1.
The type of the result is the same as the type of the operand.

EXAMPLE:
3.2 ceiling -> 4.0
-4.8 ceiling -> -4.0
99 ceiling -> 99

ERRORS: stackunderflow, typecheck

SEE ALSO: floor, round, truncate, cvi

Troubleshooting index Postscript Index


charpath string bool charpath -

obtains the character path outlines that would result if string were shown at the current point using show. Instead of painting the path, however, charpath appends the path to the current path. This yields a result suitable for general filling, stroking, or clipping

The bool operand determines what happens if the character path is designed to be stroked rather than filled or outlined. If bool is false, charpath simply appends the character path to the current path; the result is suitable only for stroking. If bool is true, charpath applies the strokepath operator to the character path; the result is suitable for filling or clipping, but not for stroking. charpath does not produce results for portions of a character defined as images or masks rather than as paths.

The outlines of some fonts are protected. (In Level 1 implementations, this applies to all fonts; in Level 2, only to certain special fonts and not to ordinary Type 1 or Type 3 fonts.) If the current font is protected, using charpath to obtain its outlines causes the pathforall and upath operators to be disabled for as long as those outlines remain in the current path.

ERRORS: limitcheck, nocurrentpoint, stackunderflow, typecheck

SEE ALSO: show, flattenpath, pathbbox, clip

Troubleshooting index Postscript Index


clear any1 ... anyn clear

pops all objects from the operand stack and discards them.

ERRORS: (none)

SEE ALSO: count, cleartomark, pop

Troubleshooting index Postscript Index


cleardictstack - cleardictstack -

pops all dictionaries off the dictionary stack except for the permanent entries. In Level 1 implementations the permanent entries are systemdict and userdict; in Level 2 they are systemdict, globaldict, and userdict.
(In Level 1 implementations, cleardictstack is a procedure defined in userdict instead of an operator defined in systemdict.)

ERRORS: dictstackunderflow

ERRORS: (none)

SEE ALSO: begin, end

Troubleshooting index Postscript Index


cleartomark mark obj1 ... objn cleartomark -

pops the operand stack repeatedly until it encounters a mark, which it also pops from the stack
(obj1 through objn are any objects other than marks).

ERRORS: unmatchedmark

SEE ALSO: clear, mark, counttomark, pop

Troubleshooting index Postscript Index


clip - clip -

intersects the inside of the current clipping path with the inside of the current path to produce a new, smaller current clipping path.
The inside of the current path is determined by the normal PostScript non-zero winding number rule , while the inside of the current clipping path is determined by whatever rule was used at the time that path was created.

In general, clip produces a new path whose inside (according to the non-zero winding number rule) consists of all areas that are inside both of the original paths. The way this new path is constructed (the order of its segments, whether it self-intersects, etc.) is not specified.
clip treats an open subpath of the current path as though it were closed; it does not actually alter the path itself. It is permissible for the current path to be empty. The result of executing clip is always a non-empty clipping path, though it may enclose zero area.

There is no way to enlarge the current clipping path (other than by initclip or initgraphics) or to set a new clipping path without reference to the current one. The recommended way of using clip is to bracket the clip and the sequence of graphics to be clipped with gsave and grestore. The grestore will restore the clipping path that was in effect before the gsave. The setgstate operator can also be used to reset the clipping path to an earlier state.

Unlike fill and stroke, clip does not implicitly perform a newpath after it has finished using the current path. Any subsequent path construction operators will append to the current path unless newpath is executed explicitly. This can cause unexpected behavior.

ERRORS: limitcheck

SEE ALSO: eoclip, clippath, initclip, rectclip

Troubleshooting index Postscript Index


clippath - clippath -

sets the current path to one that describes the current clipping path.
This operator is useful for determining the exact extent of the imaging area on the current output device.

If the current clipping path is the result of application of the clip or eoclip operator, the path set by clippath is generally suitable only for filling or clipping. It is not suitable for stroking because it may contain interior segments or disconnected subpaths produced by the clipping process.

EXAMPLE:
clippath 1 setgray fill

This erases (fills with white) the interior of the current clipping path.

ERRORS: (none)

SEE ALSO: clip, eoclip, initclip, rectclip

Troubleshooting index Postscript Index


closefile file closefile -

closes file-in other words, breaks the association between the file object and the underlying file. For an output file, closefile first performs a flushfile. It may also take device-dependent actions, such as truncating a disk file to the current position or transmitting an end-of-file indication.

ERRORS: ioerror, stackunderflow, typecheck

SEE ALSO: file, filter, status

Troubleshooting index Postscript Index


closepath - closepath -

closes the current subpath by appending a straight line segment connecting the current point to the subpath's starting point-generally, the point most recently specified by moveto. If the current subpath is already closed or the current path is empty, closepath does not do anything

closepath terminates the current subpath. Appending another segment to the current path will begin a new subpath, even if it is drawn from the endpoint reached by the closepath.

ERRORS: limitcheck

SEE ALSO: newpath, moveto, lineto

Troubleshooting index Postscript Index


colorimage width height bits/comp matrix
datasrc0 ... datasrcn-1 multi ncomp colorimage - LEVEL 2

paints a sampled image onto the current page.
The description here only summarizes the colorimage operator.

The sampled image is a rectangular array of width x height sample values. colorimage interprets the width, height, and matrix operands in the same way as does image.

Each image sample consists of 1, 3, or 4 color components, as specified by the ncomp operand. Each component consists of bits/comp bits (1, 2, 4, 8, or 12). All components are the same size.

If ncomp is 1, the samples have only one (gray) component; the operation of colorimage is equivalent to that of image using the first five operands. If ncomp is 3, the samples consist of red, green, and blue components. If ncomp is 4, the samples consist of cyan, magenta, yellow, and black components. The 1, 3, and 4 component values are interpreted according to the DeviceGray, DeviceRGB, and DeviceCMYK color spaces, respectively , regardless of the current color space.

The multi operand is a boolean that determines how colorimage is to obtain sample data from its data sources. If multi is false, there is a single data source, datasrc0; colorimage obtains all components from that source, interleaved on a per-sample basis. If multi is true, there are ncomp data sources, datasrc0 ... datasrcn-1, one for each component. The data sources can be procedures, strings, or files, including filtered files. They must all be of the same type .

Unlike image and imagemask, colorimage does not have an alternate form in which the parameters are bundled into a single image dictionary operand. In Level 2 implementations, given the appropriate image dictionary, the image operator can do anything that colorimage can do, and many other things. For example, image can interpret color samples in any color space, whereas colorimage is limited to the DeviceGray, DeviceRGB, and DeviceCMYK color spaces.

Execution of this operator is not permitted in certain circumstances.

ERRORS: invalidaccess, ioerror, limitcheck, rangecheck, stackunderflow, typecheck,
undefined, undefinedresult

SEE ALSO: image, imagemask

Troubleshooting index Postscript Index


concat matrix concat -

concatenates matrix with the current transformation matrix (CTM). Precisely, concat replaces the CTM by matrix x CTM . The effect of this is to define a new user space whose coordinates are transformed into the former user space according to matrix.

Examples

[72 0 0 72 0 0] concat
72 72 scale

The two examples have the same effect on the current transformation.

ERRORS: rangecheck, stackunderflow, typecheck

SEE ALSO: concatmatrix, matrix, rotate, scale, setmatrix, translate

Troubleshooting index Postscript Index


concatmatrix matrix1 matrix2 matrix3 concatmatrix matrix3

replaces the value of matrix3 by the result of multiplying matrix1 x matrix2, and pushes the modified matrix3 back on the operand stack. This operator does not affect the CTM.

ERRORS: rangecheck, stackunderflow, typecheck

SEE ALSO: concat, matrix, rotate, scale, setmatrix, translate

Troubleshooting index Postscript Index


condition - condition condition DPS

creates a new condition object, unequal to any condition object already in existence, and pushes it on the operand stack. The condition initially has no contexts waiting on it . Since a condition is a composite object, creating one consumes VM. The condition's value is allocated in local or global VM according to the current VM allocation mode.

ERRORS: stackoverflow, VMerror

SEE ALSO: wait, notify

Troubleshooting index Postscript Index


configurationerror (error) LEVEL 2

occurs when setpagedevice or setdevparams has been executed with a request for a feature that either is not available in the interpreter implementation or is not currently available because of the state of the hardware. For setpagedevice, this error is generated only if the PolicyDict entry in a page device dictionary specifies that an error should be generated.

When a configurationerror is generated, a two-element array called errorinfo is placed in $error. This array contains the key and value of the request that could not be met.

SEE ALSO: setpagedevice, setdevparams

Troubleshooting index Postscript Index


copy any1 ... anyn n copy any1 ... anyn any1 ... anyn

array1 array2 copy subarray2
dict1 dict2 copy dict2
string1 string2 copy substring2
packedarray1 array2 copy subarray2
gstate1 gstate2 copy gstate2

performs two entirely different functions, depending on the type of the topmost operand.

In the first instance, where the top element on the operand stack is a non-negative integer n, copy pops n from the stack and duplicates the top n elements on the operand stack as shown above. This form of copy operates only on the objects themselves, not on the values of composite objects.

EXAMPLE:
1 2 3 2 copy -> 1 2 3 2 3
1 2 3 0 copy -> 1 2 3

In the other instances, copy copies all the elements of the first composite object into the second. The composite object operands must be of the same type, except that a packed array can be copied into an array. This form of copy copies the value of a composite object. This is quite different from dup and other operators that copy only the objects themselves . However, copy performs only one level of copying. It does not apply recursively to elements that are themselves composite objects; instead, the values of those elements become shared.

In the case of arrays or strings, the length of the second object must be at least as great as the first; copy returns the initial subarray or substring of the second operand into which the elements were copied. Any remaining elements of array2 or string2 are unaffected. copy cannot copy into packed arrays, because they are read-only, but it can copy packed arrays into ordinary arrays.

In the case of dictionaries, Level 1 implementations require that dict2 have a length of zero and a maxlength at least as great as the length of dict1. Level 2 implementations do not impose this restriction, since dictionaries can expand when necessary.

The attributes (literal or executable and access) of the result are normally the same as those of the second operand. However, in Level 1 implementations, the access attribute of dict2 is copied from that of dict1.

If the value of the destination object is in global VM and any of the elements copied from the source object are composite objects whose values are in local VM, an invalidaccess error occurs .

EXAMPLE:
/a1 [1 2 3] def
a1 dup length array copy -> [1 2 3]

ERRORS: invalidaccess, stackoverflow, rangecheck, stackunderflow, typecheck

SEE ALSO: dup, get, put, putinterval

Troubleshooting index Postscript Index


copypage - copypage -

transmits one copy of the current page to the current output device without erasing the current page or changing the graphics state. This is in contrast to showpage, which performs the equivalent of an erasepage and an initgraphics. Aside from these differences, the behavior of copypage is identical to that of showpage.

copypage is intended primarily as a debugging aid or as a means of printing successive pages with incrementally accumulated contents. Routine use of copypage as a substitute for showpage may severely degrade the page throughput of some PostScript printers. To print multiple copies of the same page, use the #copies implicit parameter of showpage or the NumCopies parameter of setpagedevice.

ERRORS: (none)

SEE ALSO: showpage, erasepage

Troubleshooting index Postscript Index


cos angle cos real

returns the cosine of angle, which is interpreted as an angle in degrees.
The result is a real.

EXAMPLE:
0 cos -> 1.0
90 cos -> 0.0

ERRORS: stackunderflow, typecheck

SEE ALSO: atan, sin

Troubleshooting index Postscript Index


count any1 ... anyn count any1 ... anyn n

counts the number of items on the operand stack and pushes this count on the operand stack.

EXAMPLE:
clear count -> 0
clear 1 2 3 count -> 1 2 3 3

ERRORS: stackoverflow

SEE ALSO: counttomark

Troubleshooting index Postscript Index


countdictstack - countdictstack int

counts the number of dictionaries currently on the dictionary stack and pushes this count on the operand stack.

ERRORS: stackoverflow

SEE ALSO: dictstack, begin, end

Troubleshooting index Postscript Index


countexecstack - countexecstack int

counts the number of objects on the execution stack and pushes this count on the operand stack.

ERRORS: stackoverflow

SEE ALSO: execstack

Troubleshooting index Postscript Index


counttomark mark obj1 ... objn counttomark mark obj1 ... objn n

counts the number of objects on the operand stack starting with the top element and continuing down to but not including the first mark encountered. obj1 through objn are any objects other than marks.

EXAMPLE:
1 mark 2 3 counttomark -> 1 mark 2 3 2
1 mark counttomark -> 1 mark 0

ERRORS: stackoverflow, unmatchedmark

SEE ALSO: mark, count

Troubleshooting index Postscript Index


cshow proc string cshow - LEVEL 2

invokes proc once for each operation of the font mapping algorithm. The value of currentfont during
the execution of proc is the base font that the algorithm ultimately selects. When proc is invoked, the stack contains three values: the selected character's code (an integer) and the x and y components of the width vector for the character in the user coordinate system. cshow does not paint the character and does not change the current point, although proc may do so. When proc completes execution, the value of currentfont is restored.

cshow can be used to provide careful positioning of individual characters while taking advantage of the composite font mapping machinery of the interpreter. cshow is intended primarily for use with composite fonts . However, it can also be used with a base font. The mapping algorithm for a base font simply selects consecutive characters from the string.

ERRORS: invalidfont, invalidaccess, nocurrentpoint, rangecheck, stackunderflow, typecheck

SEE ALSO: ashow, awidthshow, kshow, show ,widthshow, xshow, xyshow, yshow

Troubleshooting index Postscript Index


currentblackgeneration - currentblackgeneration proc LEVEL 2

returns the current black generation function in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setblackgeneration

Troubleshooting index Postscript Index


currentcacheparams - currentcacheparams mark size lower upper LEVEL 2

pushes a mark object followed by the current cache parameters on the operand stack. The number of cache parameters returned is variable (see setcacheparams).

ERRORS: stackoverflow

SEE ALSO: setcacheparams, setsystemparams, setuserparams

Troubleshooting index Postscript Index


currentcmykcolor - currentcmykcolor cyan magenta yellow black LEVEL 2

returns the current color in the graphics state according to the cyan-magenta-yellow-black color space. If the current color space is DeviceCMYK, currentcmykcolor returns the color values most recently specified by setcmykcolor or setcolor. If the current color space is DeviceRGB or DeviceGray, currentcmykcolor converts the current color to CMYK. For any other color space, currentcmykcolor returns 0.0 0.0 0.0 1.0.

ERRORS: stackoverflow

SEE ALSO: setcmykcolor

Troubleshooting index Postscript Index


currentcolor - currentcolor comp1 comp2 ... compm LEVEL 2

returns the components, in the current color space, of the color specified by the current color parameters in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setcolor, setcolorspace

Troubleshooting index Postscript Index


currentcolorrendering - currentcolorrendering dict LEVEL 2

returns the value of the CIE based color rendering dictionary parameter in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setcolorrendering

Troubleshooting index Postscript Index


currentcolorscreen - currentcolorscreen redfreq redang redproc LEVEL 2
greenfreq greenang greenproc
bluefreq blueang blueproc
grayfreq grayang grayproc
If the current halftone screen was specified by setcolorscreen,
currentcolorscreen returns all 12 current halftone screen parameters in the graphics state.

If the current screen was specified by setscreen,
currentcolorscreen returns the three screen parameters repeated four times.

If the current screen was specified by sethalftone,
currentcolorscreen returns 60, 0, and the halftone dictionary, repeated four times.

ERRORS: stackoverflow

SEE ALSO: setcolorscreen, setscreen, sethalftone

Troubleshooting index Postscript Index


currentcolorspace - currentcolorspace array LEVEL 2

returns an array containing the identifying key and parameters of the color space in the graphics state. currentcolorspace always returns an array, even if the color space has no parameters and was selected by presenting just a name to setcolorspace.

ERRORS: stackoverflow

SEE ALSO: setcolorspace, setcolor

Troubleshooting index Postscript Index


currentcolortransfer - currentcolortransfer redproc greenproc blueproc grayproc LEVEL 2

returns the current transfer functions in the graphics state for all four color components.
If the current transfer functions were specified by setcolortransfer, currentcolortransfer returns those four operands.
If settransfer was used, currentcolortransfer returns the single transfer function, repeated four times.

ERRORS: stackoverflow

SEE ALSO: setcolortransfer, settransfer

Troubleshooting index Postscript Index


currentcontext - currentcontext context DPS

returns an integer that identifies the current execution context.

ERRORS: stackoverflow

SEE ALSO: fork, join, detach

Troubleshooting index Postscript Index


currentdash - currentdash array offset

returns the current dash array and offset in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setdash, stroke

Troubleshooting index Postscript Index


currentdevparams string currentdevparams dict LEVEL 2

returns a dictionary containing the keys and current values of all parameters for the device identified by string. The returned dictionary is merely a container for key-value pairs. Each execution of currentdevparams allocates and returns a new dictionary.

ERRORS: stackoverflow, VMerror

SEE ALSO: setdevparams

Troubleshooting index Postscript Index


currentdict - currentdict dict

pushes the current dictionary (the dictionary on top of the dictionary stack) on the operand stack. currentdict does not pop the dictionary stack; it just pushes a duplicate of its top element on the operand stack.

ERRORS: stackoverflow

SEE ALSO: begin, dictstack

Troubleshooting index Postscript Index


currentfile - currentfile file

returns the file object from which the PostScript interpreter is currently or was most recently reading program input. Precisely, currentfile returns the topmost file object on the execution stack. If there isn't one, it returns an invalid file object that doesn't correspond to any file. This never occurs during execution of ordinary user programs.

The file returned by currentfile is usually but not always the standard input file. An important exception occurs during interactive mode operation . In this case, the interpreter does not read directly from the standard input file; instead, it reads from a file representing an edited statement (each statement is represented by a different file).

The currentfile operator is useful for obtaining images or other data residing in the program file itself (see the example below). At any given time, this file is positioned at the end of the last PostScript
language token read from the file by the interpreter. If that token was a number or a name immediately followed by a white space character, the file is positioned after the white space character (the first, if there are several). Otherwise it is positioned after the last character of the token.

EXAMPLE:
/str 100 string def
currentfile str readline
here is a line of text
pop /textline exch def

After execution of this example, the name /textline
is associated with the string "here is a line of text".

ERRORS: stackoverflow

SEE ALSO: exec, run

Troubleshooting index Postscript Index


currentflat - currentflat num

returns the current value of the flatness parameter in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setflat, flattenpath, stroke, fill

Troubleshooting index Postscript Index


currentfont - currentfont font

returns the current font dictionary in the graphics state. Normally, this is the font most recently established by setfont or selectfont. However, when executed inside a font's BuildGlyph or BuildChar procedure or a procedure invoked by cshow, currentfont returns the currently selected base font (descendant of a composite font).

ERRORS: stackoverflow

SEE ALSO: rootfont, selectfont, setfont

Troubleshooting index Postscript Index


currentglobal - currentglobal bool LEVEL 2

returns the VM allocation mode currently in effect.

ERRORS: stackoverflow

SEE ALSO: setglobal

Troubleshooting index Postscript Index


currentgray - currentgray num

returns the gray value of the current color parameter in the graphics state. If the current color space is DeviceGray, currentgray returns the color value most recently specified to setgray or setcolor. If the current color space is DeviceRGB or DeviceCMYK, currentgray converts the current color to a gray value. For any other color space, currentgray returns 0.0.

ERRORS: stackoverflow

SEE ALSO: setgray, currentcolor, currentcolorspace, currenthsbcolor, currentrgbcolor

Troubleshooting index Postscript Index


currentgstate gstate currentgstate gstate LEVEL 2

replaces the value of the gstate object by a copy of the current graphics state and pushes gstate back on the operand stack. If gstate is in global VM , currentgstate will generate an invalidaccess error if any of the composite objects in the current graphics state are in local VM. Such objects might include the current font, screen function, halftone dictionary, transfer function, or dash pattern. In general, allocating gstate objects in global VM is risky and should be avoided.

ERRORS: invalidaccess, stackunderflow, typecheck

SEE ALSO: gstate, setgstate

Troubleshooting index Postscript Index


currenthalftone - currenthalftone halftone LEVEL 2

returns the current halftone dictionary in the graphics state. If the current halftone was defined by setscreen or setcolorscreen instead of by sethalftone, currenthalftone fabricates and returns a halftone dictionary (type 1 or 2) that contains the screen parameters.

ERRORS: stackoverflow, VMerror

SEE ALSO: setscreen, setcolorscreen , sethalftone

Troubleshooting index Postscript Index


currenthalftonephase - currenthalftonephase x y DPS

returns the current values of the halftone phase parameters in the graphics state. If sethalftonephase has not been executed, zero is returned for both values.

ERRORS: stackoverflow

SEE ALSO: sethalftonephase

Troubleshooting index Postscript Index


currenthsbcolor - currenthsbcolor hue saturation brightness

returns the current color parameter in the graphics state according to the huesaturation-brightness model. If the current color space is DeviceRGB, currenthsbcolor returns the color values most recently specified by sethsbcolor, setrgbcolor, or setcolor, converting them from RGB to HSB coordinates if necessary. If the current color space is DeviceGray or DeviceCMYK, currenthsbcolor first converts the current color to RGB.
For any other color space, currenthsbcolor returns 0.0 0.0 0.0.

ERRORS: stackoverflow

SEE ALSO: sethsbcolor, currentcolor, currentgray, currentrgbcolor

Troubleshooting index Postscript Index


currentlinecap - currentlinecap int

returns the current value of the line cap parameter in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setlinecap, stroke, currentlinejoin

Troubleshooting index Postscript Index


currentlinejoin - currentlinejoin int

returns the current value of the line join parameter in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setlinejoin, stroke, currentlinecap

Troubleshooting index Postscript Index


currentlinewidth - currentlinewidth num

returns the current value of the line width parameter in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setlinewidth, stroke

Troubleshooting index Postscript Index


currentmatrix matrix currentmatrix matrix

replaces the value of matrix with the value of the current transformation matrix (CTM) in the graphics state, and pushes the modified matrix back on the operand stack .

ERRORS: rangecheck, stackunderflow, typecheck

SEE ALSO: setmatrix, defaultmatrix, initmatrix, rotate, scale, translate

Troubleshooting index Postscript Index


currentmiterlimit - currentmiterlimit num

returns the current value of the miter limit parameter in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setmiterlimit, stroke

Troubleshooting index Postscript Index


currentobjectformat - currentobjectformat int LEVEL 2

returns the object format parameter currently in effect.

ERRORS: stackoverflow

SEE ALSO: setobjectformat

Troubleshooting index Postscript Index


currentoverprint - currentoverprint bool LEVEL 2

returns the value of the overprint parameter in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setoverprint

Troubleshooting index Postscript Index


currentpacking - currentpacking bool LEVEL 2

returns the array packing mode currently in effect.

ERRORS: stackoverflow

SEE ALSO: setpacking, packedarray

Troubleshooting index Postscript Index


currentpagedevice - currentpagedevice dict LEVEL 2

returns a read-only dictionary that describes the page-oriented output device in the current graphics state. currentpagedevice creates a new dictionary if necessary. If the device in the current graphics state is not a page device, currentpagedevice returns an empty dictionary (length of 0).
Changes made to the hardware state of the output device since the last execution of setpagedevice, such as changing paper trays or switches, are not immediately reflected in this dictionary. If the current context is under the control of a job server, the server sets up a device that matches the hardware state before starting each job. At the beginning of each job, therefore, the dictionary currentpagedevice returns matches the current hardware state.

ERRORS: stackoverflow, VMerror

SEE ALSO: setpagedevice

Troubleshooting index Postscript Index


currentpoint - currentpoint x y

returns the x and y coordinates of the current point in the graphics state (i.e., the trailing endpoint of the current path). If the current point is undefined because the current path is empty, currentpoint executes the nocurrentpoint error.
The current point is reported in the user coordinate system. Points entered into a path are immediately converted to device coordinates by the current transformation matrix (CTM); existing points are not changed by subsequent modifications to the CTM. currentpoint computes the user space coordinate that corresponds to the current point according to the current value of the CTM. If a current point is set and then the CTM is changed, currentpoint will report a different position in user space than it did before.

ERRORS: nocurrentpoint, stackoverflow, undefinedresult

SEE ALSO: lineto, moveto, curveto, arc

Troubleshooting index Postscript Index


currentrgbcolor - currentrgbcolor red green blue

returns the three components of the current color in the graphics state according to the red-green-blue color model. If the current color space is DeviceRGB, currentrgbcolor returns the color values most recently specified to setrgbcolor or setcolor (or transformed values specified to sethsbcolor). If the current color space is DeviceGray or DeviceCMYK, currentrgbcolor converts the current color to RGB.
For any other color space, currentrgbcolor returns 0.0 0.0 0.0.

ERRORS: stackoverflow

SEE ALSO: setrgbcolor, currentcolor, currentgray, currenthsbcolor

Troubleshooting index Postscript Index


currentscreen - currentscreen frequency angle proc
- currentscreen 60 0 halftone

returns the current halftone screen parameters (frequency, angle, and proc) in the graphics state, assuming the current screen was established by setscreen. If setcolorscreen was executed, currentscreen returns the parameters for the gray screen.
If sethalftone was executed, currentscreen returns a frequency of 60, an angle of 0, and the halftone dictionary.

ERRORS: stackoverflow

SEE ALSO: setcolorscreen, setscreen, sethalftone

Troubleshooting index Postscript Index


currentshared - currentshared bool LEVEL 2

has the same semantics as currentglobal. This operator is defined for compatibility with existing Display PostScript applications.

ERRORS: stackoverflow

SEE ALSO: setglobal, setshared

Troubleshooting index Postscript Index


currentstrokeadjust - currentstrokeadjust bool LEVEL 2

returns the current stroke adjust parameter in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setstrokeadjust

Troubleshooting index Postscript Index


currentsystemparams - currentsystemparams dict LEVEL 2

returns a dictionary containing the keys and current values of all system parameters that are defined in the implementation. The returned dictionary is merely a container for key-value pairs. Each execution of currentsystemparams allocates and returns a new dictionary.

ERRORS: stackoverflow, VMerror

SEE ALSO: setsystemparams

Troubleshooting index Postscript Index


currenttransfer - currenttransfer proc

returns the current transfer function in the graphics state, assuming that it was established by settransfer. If setcolortransfer was executed, currenttransfer returns the gray transfer function.

ERRORS: stackoverflow

SEE ALSO: settransfer, setcolortransfer

Troubleshooting index Postscript Index


currentundercolorremoval - currentundercolorremoval proc LEVEL 2

returns the current undercolor removal function in the graphics state.

ERRORS: stackoverflow

SEE ALSO: setundercolorremoval

Troubleshooting index Postscript Index


currentuserparams - currentuserparams dict

returns a dictionary containing the keys and current values of all user parameters that are defined in the implementation. The returned dictionary is a container for key-value pairs. Each execution of currentuserparams allocates and returns a new dictionary.

ERRORS: stackoverflow, VMerror

SEE ALSO: setuserparams

Troubleshooting index Postscript Index


curveto x1 y1 x2 y2 x3 y3 curveto -

adds a Bezier cubic section to the current path between the current point, referred to here as (x0, y0), and the point (x3, y3), using (x1, y1) and (x2, y2) as the Bezier cubic control points. After constructing the curve, curveto makes (x3, y3) the new current point. If the current point is undefined because the current path is empty, curveto executes the error nocurrentpoint.

The four points define the shape of the curve geometrically. The curve starts at (x0, y0), it is tangent to the line from (x0, y0) to (x1, y1) at that point, and it leaves the point in that direction. The curve ends at (x3, y3), it is tangent to the line from (x2, y2) to (x3, y3) at that point, and it approaches the point from that direction. The lengths of the lines (x0, y0) to (x1, y1) and (x2, y2) to (x3, y3) represent, in a sense, the "velocity" of the path at the endpoints. The curve is always entirely enclosed by the convex quadrilateral defined by the four points.

The mathematical formulation of a Bezier cubic curve is derived from a pair of parametric cubic equations:

The cubic section produced by curveto is the path traced by x(t) and y(t) as t ranges from 0 to 1. The Bezier control points corresponding to this curve are:

ERRORS: limitcheck, nocurrentpoint, stackunderflow, typecheck

SEE ALSO: lineto, moveto, arc, arcn, arct, arcto

Troubleshooting index Postscript Index


cvi num cvi int
string cvi int

(convert to integer) takes an integer, real, or string object from the stack and produces an integer result. If the operand is an integer, cvi simply returns it. If the operand is a real, it truncates any fractional part (i.e., rounds it toward 0) and converts it to an integer. If the operand is a string, it interprets the characters of the string as a number according to the PostScript syntax rules. If that number is a real, cvi converts it to an integer. cvi executes a rangecheck error if a real is too large to convert to an integer. (See the round, truncate, floor, and ceiling operators, which remove fractional parts without performing type conversion.)

EXAMPLE:
(3.3E1) cvi -> 33
-47.8 cvi -> -47
520.9 cvi -> 520

ERRORS: invalidaccess, rangecheck, stackunderflow, syntaxerror, typecheck, undefinedresult

SEE ALSO: cvr, ceiling, floor, round, truncate

Troubleshooting index Postscript Index


cvlit any cvlit any

(convert to literal) makes the object on the top of the operand stack have the literal instead of executable attribute.

ERRORS: stackunderflow

SEE ALSO: cvx, xcheck

Troubleshooting index Postscript Index


cvn string cvn name

(convert to name) converts the string operand to a name object that is lexically the same as the string. The name object is executable if the string was.

EXAMPLE:
(abc) cvn -> /abc
(abc) cvx cvn -> abc

ERRORS: invalidaccess, limitcheck, stackunderflow, typecheck

SEE ALSO: cvs, type

Troubleshooting index Postscript Index


cvr num cvr real
string cvr real

(convert to real) takes an integer, real, or string object and produces a real result. If the operand is an integer, cvr converts it to a real. If the operand is a real, cvr simply returns it. If the operand is a string, it interprets the characters of the string as a number according to the PostScript syntax rules. If that number is an integer, cvr converts it to a real.

ERRORS: invalidaccess, limitcheck, stackunderflow, syntaxerror, typecheck, undefinedresult

SEE ALSO: cvi

Troubleshooting index Postscript Index


cvrs num radix string cvrs substring

(convert to string with radix) produces a text representation of the number num in the specified radix, stores the text into the supplied string (overwriting some initial portion of its value), and returns a string object designating the substring actually used. If string is too small to hold the result of the conversion, cvrs executes the error rangecheck.

If radix is 10, cvrs produces the same result as cvs when applied to either an integer or a real. That is, it produces a signed integer or real token that conforms to the PostScript language syntax for that number.

If radix is not 10, cvrs converts num to an integer, as if by cvi. Then it treats the machine representation of that integer as an unsigned positive integer and converts it to text form according to the specific radix. The resulting text is not necessarily a valid number. However, if it is immediately preceded by the same radix and #, the combination is a valid PostScript language token that represents the same number.

EXAMPLE:
/temp 12 string def
123 10 temp cvrs -> (123)
-123 10 temp cvrs -> (-123)
123.4 10 temp cvrs -> (123.4)
123 16 temp cvrs -> (7B)
-123 16 temp cvrs -> (FFFFFF85)
123.4 16 temp cvrs -> (7B)

ERRORS: invalidaccess, rangecheck, stackunderflow, typecheck

SEE ALSO: cvs

Troubleshooting index Postscript Index


cvs any string cvs substring

(convert to string) produces a text representation of an arbitrary object any, stores the text into the supplied string (overwriting some initial portion of its value), and returns a string object designating the substring actually used. If the string is too small to hold the result of conversion, cvs executes the error rangecheck.

If any is a number, cvs produces a string representation of that number. If any is a boolean, cvs produces either the string true or the string false. If any is a string, cvs copies its contents into string. If any is a name or an operator, cvs produces the text representation of that name or the operator's name. If any is any other type, cvs produces the text --nostringval--.

If any is a real number, the precise format of the result string is implementation dependent and not under program control. For example, the value 0.001 might be represented as 0.001 or as 1.0E-3.

EXAMPLE:
/str 20 string def
123 456 add str cvs -> (579)
mark str cvs -> (--nostringval--)

ERRORS: invalidaccess, rangecheck, stackunderflow, typecheck

SEE ALSO: cvi, cvr, string, type

Troubleshooting index Postscript Index


cvx any cvx any

(convert to executable) makes the object on top of the operand stack have the executable instead of literal attribute.

ERRORS: stackunderflow

SEE ALSO: cvlit, xcheck

Troubleshooting index Postscript Index


Original file name: PSL2c