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

NextPrevUpTopContentsIndex

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

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, 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 or unspecified, the logical resolution of the specified screen is used, or the logical resolution of the default screen if no screen is specified. The dpi argument 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
Printing from the CAPI—the Hardcopy API


CAPI User Guide and Reference Manual (Windows version) - 3 Aug 2017

NextPrevUpTopContentsIndex