printer-physical-offset

Function

Package: common-graphics

Arguments: printer-stream

Takes a printer stream and returns a position indicating the left and top "physical" margins outside of which the printer is not able to print. The returned position is in stream units (which means pixel units unless (setf stream-units-per-inchstream-units-per-inch) has been called to change the scaling factor, which is allowed for a printer stream since it is a subclass of scaling-stream). The right physical margin will be the same size as the left, and the bottom the same size as the top. This margin is typically around a quarter of an inch for a laser printer.

An important aspect of this physical margin is that whenever you draw something on a printer stream, the output will always be offset by this physical margin from the edge of the paper, no matter what the "logical" margins are as returned for example by

(left-marginleft-margin printer-stream t)

So if you want to draw something on a printer stream at a half of an inch from the left edge of the paper, then the x position at which you need to draw will be:

(- (floor (stream-units-per-inch printer-stream) 2) 
                                ; half an inch
   (position-x (printer-physical-offset printer-stream)))

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.