All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

with-print-job Macro

Summary

Creates a print job that prints to the specified printer.

Package

capi

Signature

with-print-job (var &key pane jobname printer owner drawing-mode) &body body

Arguments
var
A symbol.
pane
A output-pane or nil.
jobname
A string or nil.
printer
A printer or nil.
owner
An owner window, or nil.
drawing-mode
One of :compatible, :quality or nil.
body
Lisp forms.
Description

The macro with-print-job creates a print job that prints to printer. If printer is not specified, the default printer is used. The macro binds var to a graphics port object and evaluates the forms in body as an implicit progn. Printing is performed by these forms using Graphics Ports operations to draw to var.

If pane is non-nil it must be an instance of output-pane or a subclass. In this case var is bound to pane, and pane is modified within the dynamic extent of the with-print-job so all drawing operations draw to the printer instead of pane. This can be useful when implementing printing by modifying existing redisplay code that is written expecting an output-pane. If pane is nil, var is bound to a graphics port of type printer-port, which is alive only inside the body of with-print-job, and sends any drawing into it to the printer.

jobname is the name of the print job. The default value is nil, meaning that the name "Document" is used.

The actual printing is done by using one of the macros with-document-pages or with-page, within the scope of with-print-job.

owner specifies the owner of the printer port object, which calls to port-owner will return. This has an effect only when pane is nil.

drawing-mode should be either :compatible which causes drawing to be the same as in LispWorks 6.0, or :quality which causes all the drawing to be transformed properly, and allows control over anti-aliasing on Microsoft Windows and GTK+. If pane is supplied, then pane determines the print job's drawing-mode, otherwise the default value of drawing-mode is :quality.

For more information about drawing-mode, see 13.2.1 The drawing mode and anti-aliasing.

Examples
(example-edit-file "capi/graphics/metafile")
(example-edit-file "capi/printing/fit-to-page")
(example-edit-file "capi/printing/multi-page")
(example-edit-file "capi/printing/page-on-demand")
See also

port-owner
printer-port-handle
printer-port-supports-p
set-printer-options
with-document-pages
with-page
with-page-transform
16 Printing from the CAPI—the Hardcopy API
13 Drawing - Graphics Ports


CAPI User Guide and Reference Manual (Windows version) - 01 Dec 2021 19:33:57