Path: 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 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