CLIM supports hardcopy output through the macro with-output-to-postscript-stream .
Arguments: (stream-var file-stream
) :header-comments :multi-page)
Summary: Within body, stream-var is bound to a stream that produces PostScript code.
The following example writes a PostScript program that draws a square, a circle, and a triangle to a file named
(defun print-icons-of-high-tech-to-file ()
(file-stream "icons-of-high-tech.ps" :direction :output)
(let* ((x1 150) (y 250) (size 100)
(x2 (+ x1 size))
(radius (/ size 2))
(base-y (+ y (/ (* size (sqrt 3)) 2))))
(- x1 size) (- y size)
(+ x2 radius) (- y radius)
(+ x1 radius) y
The second example uses multi-page mode to draw a graph of the superclasses of the class window-stream by writing a PostScript program to the file some-pathname .
(with-open-file (file some-pathname :direction :output)
(stream file :multi-page t)
#'(lambda (object s)
(write-string (string (clos:class-name object)) s))
Note that with-output-to-postscript-stream is defined in the loadable module "clim-postscript". See 1.5, Loading CLIM for details of how to load CLIM and associated modules.
Common Lisp Interface Manager 2.0 User's Guide - 20 Sep 2011