PC's printing on the net

2007-12-25 8:03:00

Thanks to all who have replied.

My original problem was when printing from DOS PC's running Windows to a

Postscript printer attached to my SparcServer, the Postscript job would

get trashed in transit. Printing to a file and dumping the file on the

printer would also screw things up.

The problem is that Windows decided to throw a Control-D as the very

first character in the file. This screws up the identifying line, and

the postscript printer doesn't think the job is a postscript job.

So, there are a variety of fixes. The easiest seems to be best summed up

in my InfoWorld Windows 3.1 secrets (page 614):

*ahem*

"PostScript files created from Windows (like most PostScript files) contain a

Ctrl+D at the beginning of the print job. This control character resets the

printer to prepare it to receive the settings for the next job. This Ctrl+D

confuses Unix systems; if you transfer the file to a Unix computer to print

the job on a different printer, that computer will treat the character Ctrl+D

as an end-of-file chatacter. (These two companies ought to talk.) [sic]

You can eliminiate the Ctrl+D from PostScript files output from Windows by

adding the following line to the [PostScript Printer, LPT1:] section of your

WIN.INI file (look for the particular name of your printer and the port you are

using, not these literal words):

        [PostScript Printer, LPT1:]

        CtrlD=0

"

Well, I did this, and it didn't work. Maybe someone else can tinker with it.

My second problem was I created a new printer in my printcap, set a filter

to run and a little sed script to filter out the first ctrl-d. The problem

with my solution was that I was setting a filter that was later set to a

remote printer on a remote machine (rm= rp=) via a tc= reference. Ahhhh,

sez some codeprof. On remote printers, the filter commands on the local

printcap are ignored.

Sooo, off to my filters, and here is what I ended up with. This works fine,

and my users are happily dumping jobs from windows into the spooler to print

off our sparcserver.

First, my printcap:

lwdos|macdos|Mac Laserwriter with dos filter: \

        :lp=/dev/null:if=/usr/local/lib/lwdos.filt:lf=/tmp/lwdos.log:

iprdos|IMAGEN dos:\

        :lp=/dev/null:if=/usr/local/lib/iprdos.filt:

lw|mac|Laserwriter|Mac Laserwriter: \

        :rp=mac:rm=icarus:sd=/var/spool/lw:

flp|Okidata|The Fast Line Printer: \

        :rp=flp:rm=erika:sd=/var/spool/flp:

slp|lp|Panasonic|The Slow Line Printer: \

        :rp=slp:rm=erika:sd=/var/spool/slp:

ipr|IMAGEN:\

        [long imagen printcap truncated]

The /usr/local/lib/lwdos.filt file:

#!/bin/sh

# This filter will strip off the Control-D in the first line that

# is generated by many postscript jobs from Windows. It then hands

# off the job to the appropriate printer.

#

# des wrt 01/13/93 - write

sed '1s/^D//'|/usr/ucb/lpr -Plw

(note that the ^D in the middle here should be a real live ^D. I changed it

to prevent certain mailers from barfing)

And voila. Thins are working peachy. Thanks to the masses for helping me

out with this thing. Twould be nice to have some real documentation on

how the printcap is handled. TFMP and TFM are not helpful at all.

---------------------.--------------------.--------------------------------

Dave Shevett | Unipress Software | "The shortest distance between

Systems Jockey | Edison, NJ USA | two puns is a straight line..."

shevett@unipress.com | (908)287-2100 x921 | - Doc Webster

Comments

Got something to say?

You must be logged in to post a comment.