Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!mit-eddie!uw-beaver!tektronix!pogo!richk
From: richk@pogo.GPID.TEK.COM (Richard G. Knowles)
Newsgroups: comp.lang.postscript
Subject: Re: Imageable Region
Keywords: They're all different.
Message-ID: <5804@pogo.GPID.TEK.COM>
Date: 10 Aug 88 20:41:25 GMT
References: <7761@dcatla.UUCP>
Reply-To: richk@pogo.GPID.TEK.COM (Richard G. Knowles)
Organization: Tektronix, Inc., Wilsonville,  OR.
Lines: 31

In article <7761@dcatla.UUCP> dudkl@dcatla.UUCP (Danny K. Llewallyn) writes:
>  I am looking for a PostScript procedure that determines the imageable
>  region of the printer.  I seem to remember that there is a method of
>  determining this as there is one for determining the printer's resolution.

The only clean way I have found is to do the following:

	initgraphics % make sure CTM and clippath are at defaults
	clippath     % surrounds the imageable area
	pathbbox

and the stack will contain the lower left and upper right boundaries of the
imageable area in user space terms.  Replacing "initgraphics" with "initclip
matrix identmatrix setmatrix" will produce numbers in terms of pixels.

One way of determining the device resolution is to look at the default CTM
scaling factors and multiply by 72.0 (72 points to the inch) (DPI / 72 ==
default scale).  The only real bother here is that X and Y scale factors may
be different (DPI might be different in X and Y directions) and that the X
and Y scale factors might be in the c and b matrix positions, respectively, 
instead of the more common a and d positions, respectively.  This happens
when the paper is fed in in the landscape orientation (rotated) rather than
the usual portrait orientation.

Another way to determine DPI is to use the user space and device space
"clippath pathbbox" values.
    X DPI = USERurx / DEVICEurx * 72
    Y DPI = USERury / DEVICEury * 72

Note that these depend on Adobe's definition of default user space units
being points (although 72.0 is not exactly a point).