-
save: Saves the current graphics state on the graphics state stack.
save % Saves the current state for later restoration
-
scale: Scales the current coordinate system by
sx
andsy
.2 2 scale % Doubles the size of the coordinate system
-
scalefont: Scales a font to a specified size.
/Helvetica findfont 12 scalefont setfont % Scales Helvetica to 12 points
-
scheck: Checks if an object is a shared object.
/x 42 def x scheck % Returns false unless x is declared in a shared environment
-
search: Searches for a substring in a string and returns a boolean and the index.
(World) (Hello, World!) search % Returns true, the index of "World" in "Hello, World!", and the substrings before and after "World"
-
selectfont: Combines
findfont
andscalefont
in one step, selecting a font and scale./Helvetica 12 selectfont % Selects and sets Helvetica at 12 points
-
serialnumber: Returns the serial number of the device.
serialnumber % Might return 123456789
-
setbbox: Sets the bounding box for a path.
0 0 100 100 setbbox % Sets the bounding box from (0,0) to (100,100)
-
setblackgeneration: Sets the procedure used to generate black in color separation.
/myBlackGen { ... } def setblackgeneration
-
setcachedevice: Sets the character cache device.
0 0 10 10 300 300 setcachedevice % Sets cache device parameters for character
-
setcachelimit: Sets the maximum number of entries in the font cache.
100 setcachelimit % Limits cache to 100 entries
-
setcacheparams: Sets parameters for the font cache.
/MaxCache 1000 setcacheparams % Sets the maximum cache size to 1000
-
setcharwidth: Sets the character width for the font being defined.
500 0 setcharwidth % Sets character width to 500 units
-
setcmykcolor: Sets the current color using CMYK color model values.
0 0 0 1 setcmykcolor % Sets the color to black
-
setcolor: Sets the current color using the specified color object.
[1 0 0] setcolor % Sets the color to red in an RGB color space
-
setcolorrendering: Sets the color rendering dictionary.
/myCRD { ... } def setcolorrendering
-
setcolorscreen: Sets the halftone screen for color printing.
/myScreen { ... } def setcolorscreen
-
setcolorspace: Sets the current color space.
/DeviceRGB setcolorspace % Sets color space to RGB
-
setcolortransfer: Sets the color transfer function.
/myTransfer { ... } def setcolortransfer
-
setdash: Sets the line dash pattern.
[10 5] 0 setdash % Sets a dash pattern of 10 units on, 5 off
-
setdevparams: Sets device parameters.
<< /PageSize [612 792] >> setdevparams % Sets page size for device
-
setfileposition: Sets the position within a file.
file 100 setfileposition % Sets the file position to byte 100
-
setflat: Sets the flatness tolerance.
0.5 setflat % Sets flatness to 0.5
setfont: Sets the current font to use.
postscript /Helvetica findfont 12 scalefont setfont % Sets Helvetica at 12 points as the current font
-
setglobal: Sets the global allocation mode (true for global, false for local).
true setglobal % Allocates storage in global VM
-
setgray: Sets the current color to a shade of gray.
0.5 setgray % Sets the color to a medium gray
-
setgstate: Sets the graphics state using a dictionary.
/myGState gstate def setgstate % Restores graphics state from myGState
-
sethalftone: Sets the halftone parameters.
/myHalftone { ... } def sethalftone
-
sethalftonephase: Sets the phase of the halftone screen.
<< /Phase [10 10] >> sethalftonephase % Sets halftone phase to (10,10)
-
sethsbcolor: Sets the current color using HSB model values.
0.5 1 1 sethsbcolor % Sets the color to bright pure green
-
setlinecap: Sets the style of line caps for drawing lines.
1 setlinecap % Sets line cap style to round
-
setlinejoin: Sets the style of line joints for drawing lines.
1 setlinejoin % Sets line join style to round
-
setlinewidth: Sets the width of lines drawn from here on.
2 setlinewidth % Sets line width to 2 units
-
setmatrix: Replaces the current transformation matrix.
[1 0 0 1 0 0] setmatrix % Resets transformation matrix to identity
-
setmiterlimit: Sets the miter limit for line joins.
10 setmiterlimit % Sets miter limit to 10
-
setobjectformat: Sets the format for storing objects.
3 setobjectformat % Sets object format to level 3