witr@rwwa.COM (Robert Withrow) (04/30/91)
Previously, I asked for assistance on getting PostScript (tm) printers working on SVR4.0.2.0 and, especially, for help with the POSTIO filter. Several people wrote or posted with assistance. Two wrote with detailed instructions: I have appended those instructions at the end of this post. Unfortunately, none of the suggestions worked for my setup. First, they all required the use of a serial port and I wanted to use the parallel port. Second, even when I attached the printer to a serial port it still didn't work. The symptom in each case was that the POSTIO filter would get into a loop talking to the printer and would never print anything. While several people assured me that the postio filter works on their system, I must conclude that it is buggy, and may or may not work on a specific system, depending on the characteristics of the printer. Also, no one was able to provide me with a MAN page for POSTIO, even though it has 10 or 12 options. I really don't know what it is supposed to do; the FM is silent about that. Also, I discovered a bug in either the documentation of the /dev/lp, or with the initialization of the system: the /dev/lp driver is not mentioned in the autopush file read at init time and so it doesn't have ldterm pushed onto it when it is opened. Since the documentation claims that /dev/lp obeys TERMIO(7), this could be considered a bug. All is not lost, however. I went and got the PostScript reference manual and hacked together the following programlet: If you replace the original /usr/lib/lp/postscript/postio with this the printer seems to work fine (when attached to /dev/lp). It isn't fancy and it doesn't detect printer errors, but dumb and functional is much better than fancy and nonfunctional. Note that you must replace the file /usr/lib/lp/postscript/postio with this, not just modify the Command: field of the filter table: The standard interface program refers to /usr/lib/lp/postscript/postio directly to print the banner. (Alternately, you could edit the interface program). -=-=-=-=-=- /* A dumb replacement for the POSTIO filter */ #include <unistd.h> #define BUFFERSIZE (4096) #define EOFCHAR (0x04) /* Ascii EOT == ^D */ main() { unsigned char buffer[BUFFERSIZE]; int count, something = 0; while ((count=read(STDIN_FILENO,buffer,BUFFERSIZE)) > 0) { something=1; write(STDOUT_FILENO,buffer,count); } if (something) { buffer[0] = EOFCHAR; write(STDOUT_FILENO,buffer,1); } exit(0); } -=-=-=-=-=-= Other suggestions (that did not work on my system): Andy Crump ( ...!tektronix!reed!littlei!andyc | andyc@littlei.intel.com) suggested: Yep. Here's the info you need. There is certainly missing info in the SVR4 documentation and some bugs still lurking. This info works on an Apple laserwriter, QMS PS-810, and HP laserjetII with postscript cartidge for sure. Your mileage may vary with other postscript printers. Here's the scoop (do all this as root): 0) Be sure that your printer is connect to a SERIAL line and not a parallel one. 1) Configure the printer queue as such: a) lpadmin -p {name of queue} -v /dev/tty01 -T PS -I PS ^ name of serial port you are using. b) lpadmin -d {name of queue} [optional, make this the default printer] 2) Create a text file (/tmp/foo) that looks like this: Input types: postdown Output types: PS Printer types: PS Printers: any Filter type: fast Command: /usr/lib/lp/postscript/postio -q Options: PRINTER * = -L/dev/null 3) type the command : lpfilter -f postio -F /tmp/foo 4) Enable and accept the printer: accept {name of queue} enable {name of queue} 5) just to be sure: lpshut /usr/lib/lpsched 6) To print a ascii file: lp -d {name of queue} filename Try: lp /etc/passwd 7) To print a postscript file: lp -d {name of queue} -Tpostscript filename 8) to print a troff file (via /usr/ucb/troff): lp -d {name of queue} -Ttroff file This works fine for us. Let me know if you have any problems. -- Along the same lines, Lee Daniel Crocker (lee@mport.com) suggested: We at Microport use an Apple Laserwriter with our SVR4. It is on a 9600 bps serial connection, and I used the following setup procedure: (su to root) $ lpadmin -p apple -v /dev/tty00 -I PS -T PS $ lpfilter -f postio -l >temp The file "temp" should contain a line that starts "Command: /usr...". Edit this to read: Command: /usr/lib/lp/postscript/postio -l/dev/tty00 -b9600 Then continue: $ lpfilter -f postio -F temp $ rm temp $ accept apple $ enable apple $ lpadmin -d apple Now, to print a plain text file, just "lp <filename>". To print a PostScript program file, use "lp -Tpostscript <filename>". You can verify that postio can communicate with your printer by running it in interactive mode: $ /usr/lib/lp/postscript/postio -l/dev/tty00 -i After it comes up, type "executive" and press return. You will not see the word as you type it, but you will see a banner, and then the printer will start echoing what you type. From here, you can send interactive commands to the printer. Try "FontDirectory { pop == } forall". EOF (Ctrl-D) quits. -- --- Robert Withrow, R.W. Withrow Associates, Swampscott MA 01907 USA Tel: +1 617 598 4480, Fax: +1 617 598 4430, Net: witr@rwwa.COM
duc@mport.COM (Richard Ducoty) (05/07/91)
witr@rwwa.COM (Robert Withrow) writes: > Previously, I asked for assistance on getting PostScript (tm) printers > working on SVR4.0.2.0 and, especially, for help with the POSTIO filter. > Also, no one was able to provide me with a MAN page for POSTIO, > even though it has 10 or 12 options. ===================================== There is a man page in the User's Reference Manual - postio(1). I looked in the MRD (machine readable documentation), but couldn't find it there. It might have been in one of the earlier versions. Most of the filters are in URM - if you can get ahold of a copy. Richard Richard Ducoty \\\\\\\ Microport Inc. (.)(.) root@mport.com voice=> (408) 438-8649 > duc@mport.com fax=> (408) 438-7560 - uunet!mport!duc " militiae species amor est "
witr@rwwa.COM (Robert Withrow) (05/08/91)
In article <58@mport.COM> duc@mport.COM (Richard Ducoty) writes: |There is a man page in the User's Reference Manual - postio(1). Not in mine. It goes from pg to pr... Care to type it in and post it? -- --- Robert Withrow, R.W. Withrow Associates, Swampscott MA 01907 USA Tel: +1 617 598 4480, Fax: +1 617 598 4430, Net: witr@rwwa.COM
walter@mecky.UUCP (Walter Mecky) (05/11/91)
In article <1991May8.151245.15544@rwwa.COM> witr@rwwa.COM (Robert Withrow) writes: < In article <58@mport.COM> duc@mport.COM (Richard Ducoty) writes: < |There is a man page in the User's Reference Manual - postio(1). < Not in mine. It goes from pg to pr... < Care to type it in and post it? Bevor someone types you should know: post*(1) man pages are in the UNIX System V Release 4 User's Reference Manual. They are missing in the UNIX System V/386 Release 4 User's Reference Manual. ^^^^ I don't know if the only differences between the systems are the manuals ... -- Walter Mecky [ walter@mecky.uucp or ...uunet!unido!mecky!walter ]