home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!uwm.edu!zazen!psl.wisc.edu!dbk
- From: dbk@pslu1.psl.wisc.edu (Don Katz)
- Newsgroups: comp.os.vms
- Subject: Re: Postscript SETUP modules for use with DECprint
- Message-ID: <1992Nov5.222936.23759@pslu1.psl.wisc.edu>
- Date: 5 Nov 92 22:29:36 GMT
- Article-I.D.: pslu1.1992Nov5.222936.23759
- Organization: Physical Sciences Lab, UW-Madison
- Lines: 100
-
- In article <1992Oct30.220409.13671@pslu1.psl.wisc.edu>, I wrote:
- >
- >We are running DECprint Printing Services (CPS) as the symbiont to
- >serve our DEC 2150 Postscript laser printer. We would like to have
- >forms that would allow people to print text files with various numbers
- >of characters per line and lines per page, for example, 132x66, or
- >200x66, or 105x48 in landscape. We already do this for our old LN03. I
- >have read the DECprint manual, which has an example, but although I know a
- >little postscript, it is difficult to write a setup file without
- >knowing more about the Postscript emitted when a text file is sent to
- >a CPS printer.
- >
- >Question 1) Is there someone who has done this already? I would be
- >eternally grateful if you would share your setup modules with me.
-
- Two respondents, RABINOWITZ@bear.com (Ari Rabinowitz, WorkStations
- x6518) and rz81154@mcvax2.d48.lilly.com (John Hiday, Eli Lilly)
- enlightened me with the information that CPS is designed to understand
- LN03 escape sequences. So we were able to use our existing library of
- setup modules by doing the following:
-
- 1) redefine the searchlist used for setup modules to include
- laser.tlb (our LN03 setup library).
-
- $ define/sys/exec cps_lib cps$devctl,"laser/data_type=ansi"
-
- The /data_type=ansi qualifier is required. This indicates that the
- library should only be searched when the input in ANSI data, and that
- the contents are ANSI escape sequences, and should be so interpreted.
-
- 2) Stop and restart the queue to force it to read the new logical name.
-
- $ stop/queue/next psl_alcove_ps
- $ start/queue psl_alcove_ps
-
- Couldn't have been simpler. Thank you very much to both Ari and John.
-
- Carl Lydick < CARL@SOL1.GPS.CALTECH.EDU > provided access to his
- postscript setup modules:
-
- Send> mail to FILESERV@SOL1.GPS.CALTECH.EDU containing the line
- >
- > SEND ASCII_TO_POSTSCRIPT
- >
- > as the body of the message. You'll receive several files that do the sort of
- > stuff you're asking about (not to mention one that prints crossword puzzles :-)
-
- These looked great, but although they worked fine when I prepended
- them to a text file, using them as setup modules did not work for me
- (the printer just sat there waiting for data until I killed the
- entry). I did not try to diagnose the problem, since the first
- solution worked for us.
-
- In answer to my second question:
-
- >
- > Question 2) Is there a way to capture the postscript emitted by the
- > symbiont into a file, so I can more easily write and test setup
- > modules?
-
- Ari Rabinowitz replied:
- >
- > Yes, again. What I did for this is to create a postscript setup module
- > which just reads the input sent to the printer and prints it back to
- > the user. To use it you have to specify /SETUP=PSSAVE/PARAM=MESS=KEEP
- > which creates a log file in your SYS$LOGIN. The Postscript setup module
- > must be inserted into a postscript device control library which is
- > pointed to by the Library Search List defined above.
- >
- > The actual postscript module follows:
- >
- > %! PSSAVE setup module to save the Postscript output from the Symbiont
- > save /stl 65535 string def /gtl { currentfile stl readline { sl } { sl
- > exit } ifelse } def /sl { print (\n) print } def /rdt { { gtl } loop
- > restore } def rdt
- >
- > What this does is save the current context, then define a maximum length
- > string to store the input. It then defines gtl which reads the line and
- > calls sl to print the line, and exit if at the end of input. Sl simply
- > writes the line to the messages, which go to the log file if you specify
- > /PARAM=MESS=KEEP. rdt just loops calling gtl until gtl exits, then it
- > restores the context.
- >
- > Be warned that the ANSI translator has a tendency to send a lot of
- > postscript preamble before your actual data.
-
- I did not try this. This postscript module uses the same principle as
- Carl Lydick's modules, that is, the postscript code reads its own
- input stream.
-
- Thanks to everyone who replied. The net has proven its worth once
- more.
-
- Don
-
- --
- -----------------------------------------------------------------------------
- Don Katz . Physical
- .- / \ -. Sciences
- University of Wisconsin - Madison ./' /+-+\ `\. Laboratory E-MAIL
-