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.
The printer argument should be a printer object returned by current-printer or print-dialog. This 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.
Print directly to the device.
Print to a file chosen by the user at printing time.
Print to the file given by pathname.
Print all pages.
Print from this page to the page given by last-page.
Print in landscape mode.
Print in portrait mode.
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)))
CAPI User Guide and Reference Manual (Macintosh version) - 3 Aug 2017