Article View: comp.lang.postscript
Article #5324Re: mirror image
From: Dick Dunn
Date: Thu, 11 Apr 1991 18:52
Date: Thu, 11 Apr 1991 18:52
36 lines
2100 bytes
2100 bytes
rberlin@birdlandEng.Sun.COM (Rich Berlin) suggests the following, in the
course of trying to get rid of page width hard-wired into a piece of
PostScript from an earlier article:
> ...The PostScript interpreter can
> ALWAYS tell your program the size of the page. Add the following
> procedure to your bag of tricks:
>
> /printable-area { % - => llx lly urx ury
> gsave clippath pathbbox grestore
> } bind def
The procedure gives just what it says--the printable area. This is seldom
the same as the page size, because most printers have to provide a "margin"
so they won't try to dump toner off the edges of the paper. (It also
reduces the memory for the page bitmap a little.)
A reasonable guess is that the margins on the printable area will be
symmetric, so adding llx to urx should give the page width. (No guarantee
there, of course; it's just a good guess. x symmetry is more likely than
y.)
Also...Rich suggests mirror-imaging as follows:
> printable-area % stack: llx lly urx ury
> 0 exch % llx lly urx 0 ury
> translate % llx lly urx
> pop pop pop % -
> -1 1 scale
Aside from the margin problem, this looks to me as if it translates up to
the top of the page (using 0 ury) as if to prepare for a vertical reflec-
tion, then does -1 1 scale, which is a horizontal reflection and will throw
the image off the page above and to the left.
--
Dick Dunn rcd@ico.isc.com -or- ico!rcd Boulder, CO (303)449-2870
...Lately it occurs to me what a long, strange trip it's been.
Technical Details
Message-ID:
<1991Apr11.185251.1450@ico.isc.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!rochester!kodak!ispd-newsserver!ism.isc.com!ico!rcdReferences:
<14828@mcdphx.phx.mcd.mot.com> <b#dg8qa@rpi.edu> <11404@exodus.Eng.Sun.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!rochester!kodak!ispd-newsserver!ism.isc.com!ico!rcd From: rcd@ico.isc.com (Dick Dunn) Newsgroups: comp.lang.postscript Subject: Re: mirror image Summary: a couple of problems Message-ID: <1991Apr11.185251.1450@ico.isc.com> Date: 11 Apr 91 18:52:51 GMT References: <14828@mcdphx.phx.mcd.mot.com> <b#dg8qa@rpi.edu> <11404@exodus.Eng.Sun.COM> Organization: Interactive Systems Corporation, Boulder, CO Lines: 36