How do I print from Linux to a Win98 print server?

How do I print from Linux to a Win98 print server?

Post by Patrick La » Mon, 20 Sep 1999 04:00:00



Sorry that if this has been asked before.  But I have looked thru the last
300 issues, could not find anything ....

I have a Caldera 2.2 machine that is hooked up to a Win98 machine. The HP
550C printer is attached to the Win98 machine.  I just wonder how I can
print stuff from my linux box to the Win98 box?  I have looked thru a few
sites and the HowTo's and found nothing really help.

What should I put on printcap?  smb.conf?

Thanks very much in advance.

Patrick.

 
 
 

How do I print from Linux to a Win98 print server?

Post by De Wild » Tue, 21 Sep 1999 04:00:00


I don't know of any other way, but this should work after some
configuration:

I assume you have a fully configured ethernet connection or something of the
sort between the two machines.
Make Win98 share your printer through the network (pick a name -- "deskjet"
will be fine). On the Linux machine, make sure you have installed the samba
package. You don't have to configure it, because your computer doesn't play
server. You'll also need a working ghostscript. The main trick is: filter
your document through ghostscript, giving something binary that your printer
will understand, then send it to the Win98 printer using the smbclient
program. I tried it some time ago, not using lpd though -- but it should
work.

Just to get you started -- here are some modifications that are presumably
partially incorrect because I'm typing them right now, but you'll get the
picture:

in /etc/printcap, create an entry:

#  deskjet attached to a Win98 machine
deskjet|lp|Deskjet 550C:\
    :sh:sd=/var/spool/lpd:\
    :lp=/dev/null:\
    :if=/usr/local/libexec/smbdjc:

create /usr/local/libexec/smbdj: (and make it executable)

--begin is here
#!/bin/sh
#
#  smbdj - Print Ghostscript-simulated PostScript on a DeskJet 550C
connected to a Win98 box
#  Installed in /usr/local/libexec/smbdj
#
#  Treat LF as CR+LF:
#
printf "\033&k2G" >/tmp/djjob$$|| exit 2

#
#  Read first two characters of the file
#
read first_line
first_two_chars=`expr "$first_line" : '\(..\)'`

if [ "$first_two_chars" = "%!" ]; then
    #
    #  It is PostScript; use Ghostscript to scan-convert and print it.
    #

    /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=cdj550 -sOutputFile=- -\
        >>/tmp/djjob$$\
        && /usr/local/bin/smbclient //Win98I*ETBIOSname/deskjet -c "put
/tmp/djjob$$" </tmp/djjob$$\
        && /usr/bin/rm -f /tmp/djjob$$\
        && exit 0
else
    #
    #  Plain text or HP/PCL, so just print it directly; print a form
    #  at the end to eject the last page.
    #
    (echo $first_line && cat && printf "\033&l0H") >> /tmp/djjob$$\
    && /usr/local/bin/smbclient //Win98I*ETBIOSname/deskjet -c "put
/tmp/djjob$$" </tmp/djjob$$\
    && /usr/bin/rm -f /tmp/djjob$$\
    && exit 0
fi

exit 2
-- end is here

Well, above is a right-now modified Deskjet 500 script I found in the
FreeBSD handbook (the OS I use and prefer).

You'll have to tamper with it to make things work. Send me mail if you can
get it running!

Good luck (and don't mind my not-so-good English)

Michiel De Wilde


Quote:> Sorry that if this has been asked before.  But I have looked thru the last
> 300 issues, could not find anything ....

> I have a Caldera 2.2 machine that is hooked up to a Win98 machine. The HP
> 550C printer is attached to the Win98 machine.  I just wonder how I can
> print stuff from my linux box to the Win98 box?  I have looked thru a few
> sites and the HowTo's and found nothing really help.

> What should I put on printcap?  smb.conf?

> Thanks very much in advance.

> Patrick.


 
 
 

How do I print from Linux to a Win98 print server?

Post by Mark Reddin » Tue, 21 Sep 1999 04:00:00


I wrote a document once on how to do the self same thing on a WindozeNT
based printer.

Try http://homepages.tesco.net/~grawlfang/Linux/print2win.html and see
if that helps.

--
Mark W J Redding
A crash reduces your expensive computer to a simple stone.

GPG KeyID: F6C8C7B0
GPG Key Server: http://pgp5.ai.mit.edu/pks-commands.html
GPG Fingerprint : 1D26 858F 358C CD8F E0AB  A2A2 83A3 799B F6C8 C7B0

Linux, use the source luke.
FreeBSD, the power to serve.

 
 
 

1. Linux print client with *Linux* print server

I'm having a similar problem with a Linux print client and a
Linux print server---my /etc/printcap on the client is set up
properly (e.g.:

lp:lp=:rm=remote.prnt.svr.dom:lp=rp  )

and the hosts.lpd file is complete (I set up both the client
and server with all relevant IPs and domains, using the
standard hosts file format (it shouldn't be the hosts.equiv
format, should it?)).  And, yet, I still get the following:

remote.prnt.svr.dom: usr/sbin/lpd: lp: Your host does not have
line printer access

Thanks in advance!

--
 John Chamberlain * The Integrity Center Inc. * Dallas, Texas
                (214) 484-6140 * (800) 456-1811
            FAX:(214) 484-6381 * FOD:(214) 484-2147
                 Pre-/Post-Employment Screening
              "objective risk management information"

2. After kernel upgrade no ppp anymore

3. Linux Raw Print Server with HP722C for Win98 Client

4. Test mail

5. Server will not print to a Linksys EPSX3 Print Server

6. Broken Mirror Repair

7. Linux Printing to a Linksys Pocket Print Server

8. eth0: mismatched read page pointers [number] vs. [number] error

9. Making Linux Print to Win95 Print Server .. How?

10. how to manage printing jobs at linux print server

11. Linux print server and printing to a NC-2110h jetdirect card dilemma

12. problems printing to intel NetportExpress PRO/100 print server with redhat 5.2 linux

13. printing to pocket print server from linux