[mod.computers.laser-printers] Info-Postscript for Laser Lovers Digest V1 #2

Laser-Lovers-Request@WASHINGTON.ARPA (Moderator) (01/09/86)

Info-Postscript for Laser Lovers Digest Thursday, January 9, 1986 11:02AM
Volume 1, Issue 2

Today's Topics:

                          diagnostic PS hack
                            Two-up troff?
                 [INFO-POSTSCRIPT] Re: Two-up troff?
               Re: [INFO-POSTSCRIPT] Re: Two-up troff?
                          N-up in Postscript
                         Varian -> PostScript
                 CalComp -> PostScript package wanted
                           get rich quick?

----------------------------------------------------------------------

Date: 11 Nov 1985 1940-PST (Monday)
From: Brian Reid <reid@glacier>
Subject: diagnostic PS hack

Here's a PostScript hack for diagnosing complex documents. If you drop
it into any environment, anywhere, it figures out the current
coordinate system and prints a grid overlaying the page that labels the
page in the current coordinate system. I've been meaning to integrate
it with an errorhandler so that it can be automatically invoked if
something goes wrong. 

I call this file PScoords.ps. I don't have a %! on it because I usually
use it by inserting it into a file that didn't print and then printing
the file a second time.

% This PS file defines some functions that look around, find the current
% coordinate system and clipping region, and draw a coordinate grid
% for it. Just drop it in to any PS context and it will cope.
%
% Brian Reid, Stanford
% April 1985

/Gdict 50 dict def Gdict begin
/Courier findfont 7 scalefont setfont
/rawshow {gsave
   currentpoint translate 0 0 transform
   /cm matrix currentmatrix def
   /ang 1 0 dtransform neg exch atan def
   initmatrix ang rotate itransform translate
   show
grestore} def

/rawstroke {
   /cm matrix currentmatrix def
   initmatrix stroke
   cm setmatrix
} def

/showgrid
{gsave
  2 setlinecap  0 setgray
  /y ymin def
  /ycount ymax ymin sub yincr idiv 1 add def
  ycount {newpath
    [3 3] 0 setdash
    y 0.0 eq {2 setlinewidth}{0.5 setlinewidth} ifelse
    xmin y moveto
    xmax y lineto rawstroke
    xorg y yincr 20 div add moveto y 20 string cvs rawshow
    /y y yincr add def
  } repeat
  /x xmin def
  /xcount xmax xmin sub xincr idiv 1 add def
  xcount {newpath
    x ymin moveto
    [10 5] 5 setdash
    x 0.0 eq {2 setlinewidth}{0.5 setlinewidth} ifelse
    x ymin moveto
    x ymax lineto rawstroke
    gsave x xincr 20 div add yorg  translate -90 rotate
        x 20 string cvs 0 0 moveto rawshow
    grestore
    /x x xincr add def
  } repeat
grestore} def

/findgrid {
    clippath pathbbox
    /ymax exch def /xmax exch def /ymin exch def /xmin exch def

    xmax xmin sub 10 div log 0.5 add truncate 10 exch exp /xincr exch def
    ymax ymin sub 10 div log 0.5 add truncate 10 exch exp /yincr exch def
    xincr 1 gt {/xincr xincr round def} if
    yincr 1 gt {/yincr yincr round def} if
    xmin xincr div dup 0 lt {2}{1} ifelse sub truncate
	xincr mul /xmin exch def
    ymin yincr div dup 0 lt {2}{1} ifelse sub truncate
	yincr mul /ymin exch def
} def

/findcenter {
  /xorg xmax xmin sub 2 div xmin add xincr div
	round xincr mul xincr 20 div add def
  /yorg ymax ymin sub 2 div ymin add yincr div
	round yincr mul yincr -20 div add def
} def

findgrid
findcenter
showgrid
end

------------------------------

Subject: Two-up troff?
Date: 19 Nov 85 10:59:08 EST (Tue)
From: "Christopher A. Kent" <cak@Purdue.EDU>

Has anyone out there thought about hacking up a ditroff translator that
prints two-up rotated output (like enscript -2r)? I'd like this a lot;
there are times when using nroff | enscript isn't quite nice enough.

chris

------------------------------

Date: Thu 21 Nov 85 08:02:26-PST
From: John Reuling <Reuling@SU-SCORE.ARPA>
Subject: [INFO-POSTSCRIPT] Re: Two-up troff?

Date: Wed, 20 Nov 85 11:00:34 est
From: ned%UPenn-Grasp%upenn.csnet@CSNET-RELAY.ARPA
To: info-postscript@su-score.arpa
Subject: Re: Two-up troff?

Do you mean ditroff or enscript? You seemed to be discussing both.
I've been thinking recently that it should be possible to design a PostScript
prelude which would do 4-up (or 2-up or n-up) printing of any PostScript
file. By modifying enough of the standard operators, like showpage, initclip,
etc., it should be possible to do this sort of printing in a completely
transparent way. After all, as the PostScript Language Manual states:

	The design of PostScript encourages building pieces ... that
	are used and reused to build up a page image. Not only can
	pieces be used in exactly their original form, but with ...
	translation, rotation and scaling, previously defined pieces
	can serve in a myriad of ways for making new composite pages.

Has anyone out there been thinking along these lines?

--Ned Batchelder (ned@UPenn.CSnet)

------------------------------

Subject: Re: [INFO-POSTSCRIPT] Re: Two-up troff?
Date: 21 Nov 85 12:08:56 EST (Thu)
From: "Christopher A. Kent" <cak@Purdue.EDU>

I mean ditroff. I'd like to be able to take ditroff input and produce
output that is similar in style to what enscript -r2 does for plain
text files. It actually seems that the easiest way to do this is to use
multi-column stuff in troff and set the page up for landscape
proportions (not particularly easy with -ms) and munge the prelude to
do a rotation of 90 degrees. That *seems* reasonable; I haven't tried
it.

chris

------------------------------

Date: Thu 21 Nov 1985 14:27:38 EST
From: Bob Pellegrino <primerd!bobsun!bob@mit-eddie.MIT.EDU>
Subject: N-up in Postscript


Here at Prime Computer, we've addressed this problem already.  The
following is the PostScript header taken from our scribe device file
for doing N-up on a page.  (NUP must be set to 2, 4, 8, or 16)  Don't
forget the device finalization string.

Bob Pellegrino
Prime Computer, Inc.

ARPA: Pellegrino@bbna
UUCP: decvax!genrad!mit-eddie!primerd!bobsun!bob
-----------------------------------------------------------------------

@Declare(GenericDevice="ScaleableLaser",
     DeviceTitle="PostScript, 16-up",
     FinalName="#.ps")
@Declare(Driver PostScript,Hunits Inch,Hraster 7200,Vunits inch,Vraster 7200)

@declare(DeviceInitialization
"%%EndComments
% PostScript Prelude for Scribe, n-up.

/PN 0 def
/NUP where {pop NUP 2 eq {/NUPI 0 def}{NUP 4 eq {/NUPI 1 def}{NUP 8 eq
 {/NUPI 2 def}{NUP 16 eq {/NUPI 3 def}{/NUP 1 def}ifelse}ifelse}ifelse}ifelse}
 {/NUP 1 def} ifelse
NUP 1 eq
{/BS {/SV save def} def
 /ES {showpage SV restore} def}
{/NUPP NUP 4 eq NUP 16 eq or def
 /PW [357 272 178.5 136] NUPI get def /PH [462 352 231 176] NUPI get def
 /NPW [2 2 4 4] NUPI get def /SCL [0.58333 0.44444 0.29167 0.22222] NUPI get def
 NUPP {/TPW 544 def /TPH 704 def} {/TPW 714 def /TPH 462 def} ifelse
 /BS {PN 0 eq {NUPP {34 44 translate} {537 39 translate 90 rotate} ifelse
      newpath 0.3 setlinewidth 0 PH TPH {0 exch moveto TPW 0 rlineto} for
      0 PW TPW {0 moveto 0 TPH rlineto} for stroke 0 0 moveto} if
  /SV save def
  PN NPW mod PW mul TPH PN NPW idiv 1 add PH mul sub translate SCL dup scale
 } def
 /ES {SV restore /PN PN 1 add def PN NUP eq {showpage /PN 0 def} if} def
} ifelse
/NOFF where {pop NOFF 1 eq {BS ES} if} if

/SC {setrgbcolor} def
/RST {100 div} def
/CVTXY {RST 792 sub abs exch RST exch} def
/RDF {WFT findfont SLT 0 eq
  {SSZ scalefont}
  {[SSZ 0 SLT sin SLT cos div SSZ mul SSZ 0 0]makefont}
  ifelse
  setfont} def
/SLT 0 def
/SI { /SLT exch def RDF } def
/WFT /Courier def
/SF { /WFT exch def RDF } def
/SSZ 10 def
/SS { /SSZ exch def RDF } def
/MT { CVTXY moveto } def
/XM {RST currentpoint exch pop moveto} def
/UL {gsave newpath CVTXY moveto RST dup 2 div 0 exch rmoveto
   setlinewidth RST 0 rlineto stroke grestore} def
/PB {/PV save def CVTXY translate pop}def
/PE {PV restore}def
/SH{show}def
/MSS {SSW RST 0 rmoveto} def
/SNS { SSW add /SSW exch def MSS} def
/MX {/SSW exch def SH MSS} def
/M2 {SH MSS MSS} def
/M {SH MSS} def
/M+ {SH 1  SNS} def
/M- {SH -1 SNS} def
%%EndProlog
")
@Declare(DeviceFinalization "PN 0 gt {showpage} if")

------------------------------

Date: Mon, 25 Nov 85 14:29:09 est
From: Rich Salz <mirror!rs%cca-unix.arpa@cca-unix.arpa>
Subject: Varian -> PostScript


Is there any kind of Varian -> PostScript translator around?
Is such a thing feasible?

tnx,
	/rich $alz

------------------------------

Date:  Tue, 26 Nov 85 16:23 MST
From:  RSanders@USGS2-MULTICS.ARPA
Subject:  CalComp -> PostScript package wanted

Has anyone written a CalComp-compatible plotting subroutine package for
PostScript yet?  I will do it in 1-2 months if no-one else will, but
don't want to re-invent the wheel.

PS - I don't have TranScript source code, so it's not "a trivial mod to
the Unix plot routines".

-- Rex
   RSanders@denver.arpa

------------------------------

Date: 26 Nov 1985 1533-PST (Tuesday)
From: Brian Reid <reid@glacier>
Subject: get rich quick?

I just got a phone call from Susan Lammers of Microsoft publishing
(or was it Micropro publishing?). (206) 828-8080. She is looking for
somebody to do "A PostScript Book".

Now I thought this was pretty curious because I think that the existing
PostScript books (the red and blue Addison-Wesley books) are pretty good.

However, it seems that in her mind those books are inadequate and poorly
written, because they use words like "matrix" and "polynomial", and are
therefore not written for ordinary people.

I get the feeling that they are looking for somebody to write a quick
"PostScript Revealed" or "Everything you ever wanted to know about
PostScript but couldn't understand because you flunked Calculus in college"
book, and make a lot of money.

If you always wanted to be a pulp author, and sell hundreds of thousands of
books to people who don't know what a matrix is, this might be your big
chance. Call her, not me.

Brian Reid
Stanford

------------------------------

End of Info-Postscript for Laser Lovers Digest
**********************************************