🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #3032

Re: Inversion of text and graphics

#3032
From: Ben Cranston
Date: Fri, 07 Sep 1990 17:03
62 lines
3265 bytes
In article <5420@kd4nc.UUCP> cld@kd4nc.UUCP (Charles D'Englere) writes:

> I need help on making a postscript file print inverted (backwards) on
> a standard piece of paper. What I mean by backwards or inverted is if
> you hold the paper up to a mirror it will read correctly. I have looked
> at both the Red and Blue books but there are no examples or information
> that I could find on that subject.

If your file is well behaved and only one page simply putting this before it:

     612 0 translate -1 1 scale

should do the trick.  One of the very nice things about Postscript is that
scale will invert the actual character drawing as well as the positioning.

If your file is well behaved but more than one page long you could redefine
the showpage (and maybe copypage if it uses it) operators to first call the
old showpage, then do the above.  Then do it once manually at the beginning
or waste a picotree and just put a showpage between the redefinition and 
your page proper.

The 612 is 8.5 (inches) times 72 (PS "units" per inch), so if your paper is
not 8.5 inches wide the number will need adjustment.  It is possible to
deduced the page width from the initial clipping region, see below.

If your file is not well-behaved (like it is a macintosh command-f file)
there is no easy solution.

> Is there any reason to get the Green and Black books? If so, what are
> the advantages?

The green book talks about integration issues and large postscript programs.
I always buy every primary source available, and only the secondaries needed.
I have red, blue, and green, and will buy black when I see it in the stores.

> Please email all responses.

Sorry, no could do, you didn't post an Internet address and those of us who
are not on Usenet proper cannot easily mail to you...


Here's a prolog that switches from portrait to landscape, by doing the moral
equivalent of this magic:

      612 0 translate 90 rotate

at the top of every page.  Maybe you can modify it into something you can use.

        /showpage [
                /showpage load dup type (operatortype) ne {/exec load} if
                0 -1 1 0 0
                /gsave load /clippath load /pathbbox load /grestore load
                3 -1 /roll load /add load 3 1 /roll load /pop load /pop load
                6 /array load /astore load /concat load
        ] cvx def

Gee, PostScript is *almost* as much fun as assembly language!
-- 
Ben Cranston <zben@umd2.umd.edu>
A determined iconoclast, it would be better to assume the opinion expressed
above is the diametric OPPOSITE to that of the Warm and Fuzzy Network Group
of Egregious State University...
Technical Details
Message-ID: <7262@umd5.umd.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!wuarchive!rex!uflorida!haven!umd5!zben
References: <5420@kd4nc.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!zaphod.mps.ohio-state.edu!wuarchive!rex!uflorida!haven!umd5!zben
From: zben@umd5.umd.edu (Ben Cranston)
Newsgroups: comp.lang.postscript
Subject: Re: Inversion of text and graphics
Summary: Set -1 horizontal scale factor
Keywords: invert, negative, postscript, commands
Message-ID: <7262@umd5.umd.edu>
Date: 7 Sep 90 17:03:06 GMT
References: <5420@kd4nc.UUCP>
Reply-To: zben@umd5.umd.edu (Ben Cranston)
Distribution: comp
Organization: University of Maryland, College Park
Lines: 62