CLIM supports hardcopy output through the macro with-output-to-postscript-stream .
Arguments: (stream-var file-stream
&key (:display-device clim::*postscript-device* ) :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 (/ size2))
(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))