with-output-to-printer

Executes body with
stream-var bound to a newly-opened printer
stream. The printer-args parameter allows any
initargs that would be passed to
open-stream for a printer
to be passed to this macro. In addition, if
units-per-inch is specified true, then the
stream-units-per-inch of the printer stream is set to this value
before executing body. If a font is passed, then
the font of the printer stream is set to this font before executing
body (just after the stream-units-per-inch is set, if this is also
done). If printer-class is
specified, it should be the name of the printer stream class to be
instantiated, which should always be a subclass of
the cg:printer class (or
that class itself).

When the printer stream is opened, the end user is presented with the
printer job dialog as usual (unless the :no-dialog-p printer-arg is
passed as true). If the user cancels from this
dialog, then cancel-value is returned from the with-output-to-printer
form.

Otherwise the values returned by the last form in body are
returned. An unwind-protect ensures that the printer stream always
gets closed.

The following example does the following:

opens a printer stream,

sets its stream-units-per-inch to 100 (which scales it
approximately the same as a video monitor),

sets its font to be a large arial font which is 48 of these stream
units tall,

Copyright (c) 1998-2012, Franz Inc. Oakland, CA., USA. All rights reserved.Documentation for Allegro CL version 9.0. The object described on this page has been modified in the 9.0 release; see the Release Notes.Created 2010.1.21.