All Manuals > CAPI Reference Manual > 1 CAPI Reference Entries

NextPrevUpTopContentsIndex

set-printer-options

Function
Summary

Sets various options in the given printer.

Package

capi

Signature

set-printer-options printer &key output-file first-page last-page orientation copies

Description

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.

Values of output-file are:

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.

Values of first-page are:

:all

Print all pages.

A integer

Print from this page to the page given by last-page.

Values of orientation are:

:landscape

Print in landscape mode.

:portrait

Print in portrait mode.

Values of copies :

A integer

The number of copies to print.

Notes

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.

Example
;; 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)))
See also

print-dialog
current-printer
with-print-job


CAPI Reference Manual - 15 Dec 2011

NextPrevUpTopContentsIndex