printer-names

Function

Package: common-graphics

Arguments:

Returns a list of strings, where each string is the name of an available printer (including networked printers). When calling open-stream to open a printer stream and passing the :no-dialog-p initarg to avoid showing the print job dialog, one of these printer names may be passed as the :printer-name initarg to open-stream in order to print on that printer. (On the other hand, when the :no-dialog-p initarg is nil, passing a :printer-name initarg does not work to determine the printer that is initially displayed on the dialog.) Here is an example that prints a half-inch tall string on each available printer, where the printed string points out the name of the printer on which it is being printed.

 
(dolist (name (printer-names))
  (format t "~&Printing to ~a.~%" name)
  (with-output-to-printer (printer
                           :no-dialog-p t
                           :orientation :landscape
                           :printer-name name)
    (setf (font printer)
      (make-font-ex nil :arial
                    (floor (stream-units-per-inch printer)
                           2)))
    (format printer "This is printer ~a." name)))

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.