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

get-page-area Function

Summary

Calculates the dimensions of suitable rectangles for use with with-page-transform.

Package

capi

Signature

get-page-area printer &key scale dpi screen

Arguments
printer
A printer.
scale
A real or nil.
dpi
An integer, a list of two integers or nil.
screen
A screen.
Description

The function get-page-area is provided to simplify the calculation of suitable rectangles for use with with-page-transform. It calculates and returns the width and height of the rectangle in the user's coordinate space that corresponds to one printable page on printer, based on the logical resolution of the user's coordinate space in dpi.

For example, if a logical resolution of 72 dpi was specified, this means that each unit in user space would map onto 1/72 of an inch on the printed page, assuming that no scale is specified.

If dpi is nil (the default), the logical resolution of screen is used, or the logical resolution of the default screen if screen is nil. dpi can be a number, or a list of two elements representing the logical resolution of the coordinate spaces in the x and y directions respectively.

If scale is specified the rectangle is calculated so that the image is scaled by this factor when printed. It defaults to 1.0.

Examples
(example-edit-file "capi/printing/fit-to-page")
(example-edit-file "capi/printing/multi-page")
(example-edit-file "capi/printing/page-on-demand")
See also

printer-metrics
with-page-transform
16 Printing from the CAPI—the Hardcopy API


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42