Displays a print dialog and returns a printer object.
capi
print-dialog &key screen owner first-page last-page print-selection-p print-pages-p print-copies-p continuation => printer
screen⇩ |
A screen or nil . |
owner⇩ |
A pane or nil . |
first-page⇩ |
A positive integer or nil . |
last-page⇩ |
A positive integer or nil . |
print-selection-p⇩ |
A generalized boolean. |
print-pages-p⇩ |
A generalized boolean. |
print-copies-p⇩ |
A generalized boolean. |
continuation⇩ |
A function or nil . |
printer |
A printer, or nil . |
The function print-dialog
displays a print dialog and returns a printer object. The printer object returned will print multiple copies if requested by the user.
If print-pages-p is t
, the user can select a range of pages to print. This should always be the case unless the application only produces single page output. If print-pages is t
, first-page and last-page can be used to initialize the page range. For example, they could be set to be the first and last pages of the document.
print-copies-p indicates whether the application handles production of multiple copies for drivers that do not support this function. Currently this should be nil
if the application uses Page Sequential printing and t
if the application uses Page on Demand printing.
If print-selection-p is t
, the user is given the option of printing the current selection. Only specify this if the application has a notion of selection and selecting printing functionality is provided.
The dialog is displayed on the current screen unless screen specifies otherwise.
owner specifies an owner window for the dialog. See 10 Dialogs: Prompting for Input for details.
If continuation is non-nil, then it must be a function with a lambda list that accepts one argument. continuation is called with the values that would normally be returned by print-dialog
. On Cocoa, passing continuation causes the dialog to be made as a window-modal sheet and print-dialog
returns immediately, leaving the dialog on the screen. The with-dialog-results macro provides a convenient way to create a continuation function.
Note that the printer object itself is opaque but programmatic setting of some printer options is available via the function set-printer-options.
(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")
print-file
print-text
set-printer-options
10 Dialogs: Prompting for Input
16 Printing from the CAPI—the Hardcopy API
CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:27