[comp.sys.ibm.pc.misc] MS-DOS WP 5.1 -> Unix-attached HP LaserJet III w. PostScript

SCHDAVZ@YaleVM.YCC.Yale.Edu (Dave Schweisguth) (06/18/91)

I would like to produce PostScript files with MS-DOS WordPerfect 5.1 which can
be uploaded to our Unix box (SGI Personal Iris) and printed on the attached
printer (an HP LaserJet III with HP's PostScript cartridge). I have defined the
printer inside WordPerfect with the driver that came with it (HP LaserJet III
(PostScript)) and set the output to a DOS file. So far so good.  But when
uploaded to the SGI, lp, cp, and cat > /dev/plp are all useless. As far as we
know the problem is not with uploading; other files have been successfully
Kermited with no trouble. Can anyone describe what it is that 1) the LaserJet
wants that 2) WordPerfect doesn't provide?
    Please mail responses, as I don't normally read these groups. I'll happily
summarize to the net if anything good shows up. Thanks.
 _____________________________________________________________________________
/                                                                             \
|   Dave Schweisguth               5386 Yale Station           203-436-2694   |
|   schdavz@yalevm.ycc.yale.edu    New Haven, CT 06502-5386                   |
|                                                                             |
| "My purpose in life is to slam a stapler against the forehead of American   |
|  pop culture."                                       -- Weird Al Yankovic   |
\_____________________________________________________________________________/

SCHDAVZ@YaleVM.YCC.Yale.Edu (Dave Schweisguth) (06/25/91)

In article <91168.135650SCHDAVZ@YaleVM.YCC.Yale.Edu>, I said:
>
>I would like to produce PostScript files with MS-DOS WordPerfect 5.1 which can
>be uploaded to our Unix box (SGI Personal Iris) and printed on the attached
>printer (an HP LaserJet III with HP's PostScript cartridge). I have defined
>the
>printer inside WordPerfect with the driver that came with it (HP LaserJet III
>(PostScript)) and set the output to a DOS file. So far so good.  But when
>uploaded to the SGI, lp, cp, and cat > /dev/plp are all useless. As far as we
>know the problem is not with uploading; other files have been successfully
>Kermited with no trouble. Can anyone describe what it is that 1) the LaserJet
>wants that 2) WordPerfect doesn't provide?
 
Thanks to all those who responded ... and the winner is Nathan Liskov, of the
MIT Laboratory for Computer Science, who was the first to suggest that we use
Kermit in binary mode! It works. We can't tell why, though; the offending files
seem to be entirely ASCII. No matter; they print.
 
For the record, the problem was _not_ ...
 
   Failure to use Kermit's text mode (the moral: always try both)
   Very long lines (which were a problem in an old WP PostScript driver; we
     have a current one without that problem)
   Presence of ^D at the beginning of the file
   Absence of the PostScript 'magic number' ('%!') at the beginning of the
     file
   Whitespace in front of the magic number
   Missing PostScript 'header' file (a la Macintosh)
 
... but all these problems were suggested to me, most by people who had
actually had these problems in the past! Evidently we weren't alone in our
difficulties. Thanks again to everyone, and keep on printin'.
 
P.S. ... apologies to the comp.lang.postscript folks, this not being a
PostScript problem at all ...
 _____________________________________________________________________________
/                                                                             \
|   Dave Schweisguth               5386 Yale Station           203-436-2694   |
|   schdavz@yalevm.ycc.yale.edu    New Haven, CT 06502-5386                   |
|                                                                             |
| "If a thing is funny, search it for a hidden truth." -- George Bernard Shaw |
\_____________________________________________________________________________/

rchui@neptune.nswc.navy.mil (Chui) (06/26/91)

I have to raise several questions for you.

1) Unix operation system machnie is multi-tasks for multi-users. You mention
about cp, cat a PostScript file output to /dev/tty## printer port. What
happen if
there is(are) a(some) print job(s) on the printer? You will get a "port busy"
message. You never able to cp, cat.

2) If there is(are) no print job(s) on the printer. When you cp, cat a large
(huge) PostScript file to /dev/tty## printer port. What happen other user sent
a print job by lp, lpr Unix commands. That will kill your processing. Because
cp, cat are not go thru the /etc/printcap file, they are just sent stdout to
that /dev/tty## port. You might never finish cp, cat that postscript file.

3) Therefore, you should used "lp, lpr -P printername filename" Unix commands
to sent print job to printer. lp, lpr are 1st come 1st serve(FIFO). To check
how many current print jobs on printer by type "lpq -P printername".The big
problem is, ...... not all the users print PostScript file.
   I don't know much about HP PostScript cartridge(you mention above).
I installed a 3rd Party PacificPage PostScript cartridge into my HP LaserJet
III. To order to print a PostScript file, First I have to sent a Escape
sequence character from my terminal tell printer switch from PCL mode
to postscript mode. Do you have to do this step in HP PostScript cartridge?
Then I sent print job to printer.

4)   Therefore, I wrote a output filter file in C language, compiler it and
link it to /etc/printcap file with :of=/usr/xxx/xxx/offil. The program 1st
check is there any print job on printer, if no, tell printer switch to post-
script mode, otherwise wait for 20 sec. check again. After switch mode, then
see if the incomming file is a PostScript file(begin with "%!"), if no, kill
the print process and exit, otherwise print the postscript file. Also I set
two different printernames in /etc/printcap file with different :of=/usr/xxx/
xxx/offil or offilps. 

Do you have any experience about question 4)? So far my program can check the
print jobs on printer and switch to postscript mode, after that the print job
go to idl(but not die), and the printer just sitting wait for characters.
If you interesting, email to me, I will sent you the output filter program.
Hopefully you can help me.

5) If you have two printers, you can avoid all these trouble. All you need
to do define two different printer names and diffewrent tty## ports in
/etc/printcap file. Use Unix command :
lpr -P hppcl filename # for PCL text file or
lpr -P hpps psfilename # for PostScript file


	-Raymond
email address rchui@neptune.nswc.navy.mil

hardy@golem.ps.uci.edu (Meinhard E. Mayer (Hardy)) (06/26/91)

There is a simnple explanation (I hope): MS-Kermit in Ascii mode (like
all DOS programs handling text) introduces extra CR-LF  characters at
the end of each line; look at a file transferred this way with emacs,
and you'll see the ^M-s. 
Binary (or Image) mode will produce an exact image of the .ps file (or
a binary file).   havee set my MS-Kermit to binary by default (same on
the NeXT kermit), and let the Unix box handle the resulting files;
this way I had no problem with postscript, dvi-files, or others. 
Annother useful hint:
Usse the unix compress available for MS-DOS (compressed at 14 bits)
and then uncompress the files at the other end.  This not only speeds
up things, but avoids CR-LF problems. 

Greetings,
Hardy 
			  -------****-------
Meinhard E. Mayer (Hardy);  Department of Physics, University of California
Irvine CA 92717; (714) 856 5543; hardy@golem.ps.uci.edu or MMAYER@UCI.BITNET