Sets various options in the given printer.
capi
set-printer-options printer &key output-file first-page last-page orientation copies
printer⇩ |
A printer. |
output-file⇩ |
A pathname designator or nil . |
first-page⇩ |
A positive integer or nil . |
last-page⇩ |
A positive integer or nil . |
orientation⇩ |
One of :landscape , :portrait or nil . |
copies⇩ |
A positive integer or nil . |
The function set-printer-options
allows some printer options for the current job to be set programmatically. Note that the user can change the various printer options in the dialog displayed by print-dialog.
printer should be a printer object returned by current-printer or print-dialog. printer should then be passed to with-print-job to print using the options specified.
The keyword arguments control which options are set. If a keyword is not passed then the option remains unchanged.
nil |
Print directly to the device. |
t |
Print to a file chosen by the user at printing time. |
A pathname |
Print to the file given by pathname. |
:all |
Print all pages. |
An integer |
:landscape |
Print in landscape mode. |
:portrait |
Print in portrait mode. |
An integer |
The number of copies to print. |
Printer objects cannot be reused after changing their options or metrics. Call current-printer after set-printer-options
to get a new printer object containing the latest settings.
;; Print two copies to the current printer. (let ((printer (capi:current-printer))) (capi:set-printer-options printer :copies 2) (capi:with-print-job (port :printer printer) (print-my-document port)))
print-dialog
current-printer
with-print-job
16 Printing from the CAPI—the Hardcopy API
CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:27