Article View: comp.lang.postscript
Article #7412Re: Imageable Region
From: Geoffrey Cooper
Date: Thu, 11 Aug 1988 21:48
Date: Thu, 11 Aug 1988 21:48
21 lines
1168 bytes
1168 bytes
The following PostScript procedure returns the printer's resolution in
DPI X & Y on the stack:
/DetermineResolution
{
gsave
initmatrix % force current matrix to default matrix.
72 0 dtransform dup mul exch dup mul add sqrt % x resolution
0 72 dtransform dup mul exch dup mul add sqrt % y resolution
grestore
}
bind def
The procedure works by putting inch vectors parallel to the axes
through the default transformation and measuring the magnitude of the
resultant vectors. Since the transformation might entail a rotation,
the measurement uses pythagorus' theorem to compute the magnitude.
- Geof
--
UUCP: {decwrl,sun}!imagen!geof ARPA: imagen!geof@decwrl.dec.com
Technical Details
Message-ID:
<1782@imagen.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!amdcad!sun!imagen!geofReferences:
<7761@dcatla.UUCP> <5804@pogo.GPID.TEK.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!amdcad!sun!imagen!geof From: geof@imagen.UUCP (Geoffrey Cooper) Newsgroups: comp.lang.postscript Subject: Re: Imageable Region Summary: Procedure to determine printer resolution. Keywords: They're all different. Message-ID: <1782@imagen.UUCP> Date: 11 Aug 88 21:48:10 GMT References: <7761@dcatla.UUCP> <5804@pogo.GPID.TEK.COM> Organization: IMAGEN Corporation, Santa Clara, CA 95052-8101 Lines: 20