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

set-printer-metrics Function

Summary

Sets the metrics in the given printer.

Package

capi

Signature

set-printer-metrics printer &key left-margin top-margin width height

Arguments
printer
A printer.
left-margin
A real or nil.
top-margin
A real or nil.
width
A real or nil.
height
A real or nil.
Description

The function set-printer-metrics sets the left margin and top margin, and the printable width and printable height, of printer to left-margin, top-margin, width and height respectively. Values outside the bounds of the printer will be corrected and values that are nil cause no change to the corresponding setting.

Examples

To set the margins as large as possible:

(let ((metrics (capi:get-printer-metrics printer)))
  (capi:set-printer-metrics printer
     :left-margin 0
     :top-margin 0
     :width
     (capi:printer-metrics-paper-width metrics)
     :height
     (capi:printer-metrics-paper-height metrics)))

Actually this sets the margins to the whole paper size, but the printer driver will move these in to take account of the minimum margins of the device.

See also

get-printer-metrics
set-printer-options
print-dialog
16 Printing from the CAPI—the Hardcopy API


CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:27