From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 15-JUN-1992 23:31:04.05
To:	info-vax@kl.sri.com
CC:	
Subj:	Re: page number on Laser printer

In article <01GL1YA3E7Y88WW400@TSU.BITNET>, GUDURU@TSU.BITNET (Mahesh) writes...
>Hi
>we have a laser printer connected to Lavc.
>I would like to be able to print page numbers on laser printouts i.e
>if I am printing something from mail, I would like to have pages numbered.
>Any info on this would be greatly appreciated.

This set of PostScript routines was sent out a year or so ago.  A couple of 
them will do exactly what you want.

Geoff Selig        Phone (514)-848-7666 |        _,  /|     The Cat's Meow
Academic Services    FAX (514)-848-7622 |        \ o.O'
Department of Computing Services        |        =(___)=
Concordia University   (H928)           |            U
Montreal, Quebec   H3G 1M8              |  ilfc594@vax2.concordia.ca
                                        |  ilfc594@conu2.BITNET
=========================  cut here  =================================

Path: daily-planet.concordia.ca!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!think.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!SOL1.GPS.CALTECH.EDU!carl
From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
Newsgroups: comp.os.vms
Subject: Re: Postscript converter wanted
Message-ID: <0094E807.46740200.6041@SOL1.GPS.CALTECH.EDU>
Date: 12 Sep 91 05:30:49 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 176


 > does anyone out there have a program (maybe with fortran source) that
 > will take a text file and convert it into a postscript file?????

 > I can't just use the postscript symbiont that is in the pd archives
 > becoz the prionter I want to print on isn't on a VAX

Why use FORTRAN as the language?  Why not use PostScript?  Here are a few
useful PostScript programs.  Just prepend the one that formats the file the way
you want it to the file you want to print, then send it to the printer.  Note: 
The string <FF> in each of these programs should be replaced with an actual
formfeed.

%*******************************************************************************
%Crossword:  Creates a crossword puzzle form or solution from the input file.
%Squares are automatically numbered.  Use a "#" for black squares and a "." for
%blank squares.
/BORDER                           
{ newpath
  COL BOXES ROW BOXES moveto
  -1 BOXES 0 BOXES rlineto
  0 BOXES -1 BOXES rlineto
  1 BOXES 0 BOXES rlineto
  closepath
  stroke 
} def 

/NUMBER 
{ COL 1 sub BOXES ROW BOXES moveto
  1 6 div BOXES 1 3 div neg BOXES rmoveto
  /Courier findfont PTSIZ scalefont setfont
  NEXTNUMBER 20 string cvs show
  /NEXTNUMBER NEXTNUMBER 1 add def 
} def 

/LETTER 
{ /LET exch def
  COL .8 sub BOXES ROW .9 sub BOXES moveto
  /Courier findfont .8 BOXES scalefont setfont
  LET show 
} def 

/BLACK 
{ newpath
  COL BOXES ROW BOXES moveto
  -1 BOXES 0 BOXES rlineto
  0 BOXES -1 BOXES rlineto
  1 BOXES 0 BOXES rlineto
  closepath
  fill 
} def 

/DOLINE 
{ 1 1 COLS
  { /COL exch def
    BORDER
    NEWSTRING COL 1 sub 1 getinterval dup (#) eq
      { BLACK pop }
      { COL 1 eq
        { NUMBER }
        { OLDSTRING COL 1 sub 1 getinterval (#) eq
          NEWSTRING COL 2 sub 1 getinterval (#) eq or { NUMBER } if
        }
        ifelse
        dup (.) eq {pop ( )} if LETTER
      }
    ifelse
  } for
   OLDSTRING 0 NEWSTRING putinterval
  /ROW ROW 1 sub def 
} def                

/MAIN 
{ /Courier findfont 8 scalefont setfont
  /INCH {72 mul} def
  .6 INCH 10.6 INCH translate
  /NEXTNUMBER 1 def
  /ROW 0 def
  currentfile read {pop} {quit} ifelse
  currentfile 512 string readline not {quit} if
  0 0 moveto
  dup
  length /COLS exch def
  /NEWSTRING COLS string def
  NEWSTRING exch 0 exch putinterval
  /OLDSTRING COLS string def
  0 1 COLS 1 sub { OLDSTRING exch (#) putinterval } for
  /BOX 7.5 INCH COLS div def
  /BOXES {BOX mul} def
  /PTSIZ 5 18 div BOXES def
  { DOLINE currentfile NEWSTRING readline not {exit} if } loop
  showpage 
} def 
MAIN
%*******************************************************************************
%PS_DOUBLE:  Two column, 80-character landscape mode
%!PS-Adobe-1.0
%%Creator: Carl J Lydick
%%DocumentFonts: Courier
%%Pages: (atend)
/Courier findfont 6 scalefont setfont
/N {showpage 90 rotate 0 -618 translate /H 538 def /V 71 def} def
/O {/H 538 def /V 431 def} def
/P {V 431 ne {O} {N} ifelse} def
/Q { V H moveto dup length 80 gt {0 80 getinterval} if show /H H 7 sub def
   H 79 le {P} if} def
/R 0 def
/S 512 string def
/T {(<FF>) search {R 0 ne {Q pop P} {pop pop /R 1 def} ifelse T} if} def
/L {90 rotate 0 -618 translate /H 538 def /V 71 def
   {currentfile S readline not {exit} if T Q} loop showpage} def
L<FF>
%*******************************************************************************
%PS_LANDSCAPE 132-character landscape
%!PS-Adobe-1.0
%%Creator: Carl J Lydick
%%DocumentFonts: Courier
%%Pages: (atend)
/Courier findfont 9 scalefont setfont
/P {showpage 90 rotate 0 -618 translate /H 594 def} def
/Q {36 H moveto dup length 132 gt {0 132 getinterval} if show /H H 9.5 sub def
    H 30 le {P} if} def
/R 0 def
/S 512 string def
/T {(<FF>) search {R 0 ne {Q pop P} {pop pop /R 1 def} ifelse T} if} def
/L {90 rotate 0 -618 translate /H 594 def {currentfile S readline not {exit} if
    T Q} loop showpage} def
L<FF>
%*******************************************************************************
%*******************************************************************************
%PS_WIDE 132-character portrait
%!PS-Adobe-1.0
%%Creator: Carl J Lydick
%%DocumentFonts: Courier
%%Pages: (atend)
/Courier findfont 6 scalefont setfont
/P {showpage /H 750 def} def
/Q { 36 H moveto dup length 132 gt {0 132 getinterval} if show /H H 7 sub def
   H 30 le {P} if} def
/R 0 def
/S 512 string def
/T {(<FF>) search {R 0 ne {Q pop P} {pop pop /R 1 def} ifelse T} if} def
/L {/H 750 def {currentfile S readline not {exit} if T Q} loop showpage} def
L<FF>
%*******************************************************************************
%PS_NUMBERED:  80-character portrait with pages numbered
%!PS-Adobe-1.0
%%Creator: Carl J Lydick
%%DocumentFonts: Courier
%%Pages: (atend)
/Courier findfont 11 scalefont setfont
/NUM 1 def
/SNUM 8 string def
/N { 540 30 moveto NUM SNUM cvs show /NUM NUM 1 add def} def
/P { N showpage /H 750 def} def
/Q { 36 H moveto dup length 80 gt {0 80 getinterval} if show /H H 12 sub def
   H 54 le {P} if} def
/R 0 def
/S 512 string def
/T {(<FF>) search {R 0 ne {Q pop P} {pop pop /R 1 def} ifelse T} if} def
/L {/H 750 def {currentfile S readline not {exit} if T Q} loop N showpage} def
L<FF>

Path: daily-planet.concordia.ca!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!SOL1.GPS.CALTECH.EDU!carl
From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
Newsgroups: comp.os.vms
Subject: Re: Postscript converter wanted
Message-ID: <0094E868.2EDF3540.6141@SOL1.GPS.CALTECH.EDU>
Date: 12 Sep 91 17:04:30 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The Internet
Lines: 4

I forgot to mention that if you don't have a symbiont (or print daemon, or
whatever) that ends each job with a control-D, you also have to append a
control-D to the file before sending it to the printer if you use my PostScript
programs to print the file.

