Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!elroy.jpl.nasa.gov!ucla-cs!rutgers!mcnc!decvax.dec.com!bacchus.pa.dec.com!shlump.nac.dec.com!shodha.enet.dec.com!epik.enet.dec.com!p_davis From: p_davis@epik.enet.dec.com (Peter Davis) Newsgroups: comp.lang.postscript Subject: Re: Imageable area of printer Message-ID: <1691@shodha.enet.dec.com> Date: 20 Sep 90 20:56:59 GMT Sender: news@shodha.enet.dec.com Organization: Digital Equipment Corporation Lines: 49 In article <1990Sep12.105456.18945@siesoft.co.uk>, crs@oxygen.siesoft.co.uk (Chris Smith) writes... >I have a program that is required to work on two different makes of >PostScript printer with different imageable areas. How do I write >it so that it can cope with this? > >Example: > >I want to draw a vertical line in the middle of the imageable area. > >If I don't know what the maximum and minimum values of the x-axis are >how can I position the line in the middle of them? > >-- >=========================================================================== >Chris Smith ...!mcvax!ukc!siesoft!crs > >=========================================================================== The easiest thing to do is find the default clippath for the device, and use that. Do this before you do anything else that might affect the clippath. Here's an example: %! clippath { /miny exch def /minx exch def /maxy miny def /maxx minx def } { /y exch def /x exch def y miny lt {/miny y def} if x minx lt {/minx x def} if y maxy gt {/maxy y def} if x maxx gt {/maxx x def} if } { } { } pathforall minx maxx add 2 div miny moveto 0 maxy miny sub rlineto stroke showpage