🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.postscript
4 messages
4 total messages Started by Jason Yan (can cook) Thu, 03 Sep 1992 06:54
ASCII-->POSTSCRIPT (need PS program, not unix, not ibm)
#2072
Author: Jason Yan (can cook)
Date: Thu, 03 Sep 1992 06:54
16 lines
1173 bytes
	Does anyone know of or have a postscript program that will
allow the printing of regular ascii files on a HP laserjet II with
a postscript cartridge?  I asked in an earlier message, but I didn't
make it clear on what I needed.  

What I need is a *POSTSCRIPT* program, not an IBM executable, not a
unix executable.  I need a poscript program that I can append text to
and have it print on a PS printer without goofing up.  If anyone has
successfully used the program Adobe has provided on an IBM environment,
please let me know how you got the printer to go from PS mode to PCL
mode after it finished printing without having the printer timeout
after every print job.  Thanks!

						Jason Yan
						ccm038@fred.ucdavis.edu
Re: ASCII-->POSTSCRIPT (need PS program, not unix, not ibm)
#2073
Author: Michael Salmon
Date: Thu, 03 Sep 1992 08:29
53 lines
2259 bytes
In article <16566@ucdavis.ucdavis.edu>, ccm038@othello.ucdavis.edu (Jason Yan (can cook)) writes:
|> 
|> 	Does anyone know of or have a postscript program that will
|> allow the printing of regular ascii files on a HP laserjet II with
|> a postscript cartridge?  I asked in an earlier message, but I didn't
|> make it clear on what I needed.  
|> 
|> What I need is a *POSTSCRIPT* program, not an IBM executable, not a
|> unix executable.  I need a poscript program that I can append text to
|> and have it print on a PS printer without goofing up.  If anyone has
|> successfully used the program Adobe has provided on an IBM environment,
|> please let me know how you got the printer to go from PS mode to PCL
|> mode after it finished printing without having the printer timeout
|> after every print job.  Thanks!

This is from "Learning PostScript, a visual approach" by Ross Smith,
ISBN 0-938-151-12-6. I haven't tried it but the code I have tried in
the book was very good. Note though NO character translations are done,
it only works for plain vanilla text.

%!
%	pstype.ps - text printing prologue
%
/printloop {
  {
    currentfile cvlit			%readline from file
    =string readline			%put it into string
    not { exit } if			%exit on ^D
    show				%otherwise display it
    
    currentpoint exch pop		%get Y position
    10.5 sub dup 36 le			%test position
      { pop showpage 72 730 moveto }	%newpage
      { 72 exch moveto }		%or newline
    ifelse
  } loop
  showpage
} bind def

/Courier findfont 10 scalefont setfont
72 730 moveto
printloop

-- 

Michael Salmon

#include	<standard.disclaimer>
#include	<witty.saying>
#include	<fancy.pseudo.graphics>

Ericsson Telecom AB
Stockholm
Re: ASCII-->POSTSCRIPT (need PS program, not unix, not ibm)
#2075
Author: Ulrich K. Boche
Date: Thu, 03 Sep 1992 16:42
31 lines
1572 bytes
In <16566@ucdavis.ucdavis.edu> Jason Yan (can cook writes:
>   Does anyone know of or have a postscript program that will
>allow the printing of regular ascii files on a HP laserjet II with
>a postscript cartridge?  I asked in an earlier message, but I didn't
>make it clear on what I needed.
>...

Many PostScript printers need a Ctrl-D character between jobs to
recognize end-of-job and start printing.  You need three things:

1. Your existing PostScript line printer emulater program (e.g. the
   one from the Adobe Green Book), let's call it "lpr.ps".

2. A file called CTLD.PS that you can create with your editor or
   word processor: its only contents should be a Ctrl-D character

3. A simple batch file like the following (assuming that by "IBM"
   you mean "IBM compatible PC"):

@echo off
cd \ps           (assuming that's the directory you use)
copy lpr.ps+ %1 +ctld.ps lpt1: >nul

   if you call the batch file lpr.bat, it would be invoked like:

lpr whatever.lst

   to print the file "whatever.lst" on a printer attached to LPT1

Ulrich Boche, IBM Germany FSC Large Systems
Disclaimer: This posting represents my own views, not those of IBM
Re: ASCII-->POSTSCRIPT (need PS program, not unix, not ibm)
#2088
Author: Charles B. Cranston
Date: Fri, 04 Sep 1992 00:06
61 lines
2471 bytes
In article <16566@ucdavis.ucdavis.edu>,
ccm038@othello.ucdavis.edu (Jason Yan (can cook)) wrote:

> ...I need a poscript program that I can append text to
> and have it print on a PS printer without goofing up.

OK, here is the solution for the "left to the reader" problem of
modifying what I posted earlier to work with PS printers that
insist upon turning LF into CR...

%!-Adobe-1.0
%%Title: asciiprint.ps
%%Creator: Ben Cranston <zben@umd2.umd.edu>
%%CreationDate: Thu Feb 8 1990
%%Pages 0

/Courier findfont 10 scalefont setfont
/colwid (m) stringwidth pop def
36 756 moveto
256 string
{ %exec
   { %loop over file
      dup currentfile exch readstring exch
      { %loop FF
         (\f) search exch
         { %loop NEWLINE
            (\r) search exch
            { %loop TAB
               (\t) search exch
               { %loop BS
                  (\b) search exch
                  show
                  not { exit } if
                  pop currentpoint exch colwid sub exch moveto
               } loop %BS
               not { exit } if
               pop currentpoint exch 36 sub colwid div .49 add cvi
               8 add dup 8 mod sub colwid mul 36 add exch moveto
            } loop %TAB
            not { exit } if
            pop 36 currentpoint exch pop
            11 sub dup 25 le { %if
               pop showpage 756
            } if
            moveto
         } loop %NEWLINE
         not { exit } if
         pop showpage 36 756 moveto
      } loop %FF
      not { exit } if
   } loop %over file
   pop showpage
} bind exec

The tab code has been changed to make it more readable and modifiable.
The two 8s are the tab stops, you should be able to change them to any
other number.  The only other change is the indentation at three should
be a tad more readable than the old indentation at two.


zben@ni.umd.edu     -KA3ZDF
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads