[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to print to a printer connected to win2000prof

Hans Steinraht wrote:

hi all,

The thing I try to figure out is how I can print from my Debian sid to a
printer that's connected to a windows 2000 proffesional machine.

I have read something about it and saw that there are different ways that might
Maybe someone has already experience with it and can point me to the right


I'm not using CUPS (just lprng and samba), and have been trying for a year and a half (off-and-on of course) to print from a Linux box to a printer hanging off a Windows box. I'm confident that it can be done, but the documentation is sadly lacking, or perhaps I'm just too dense to get it.

However, for your perusal, here's what I have, and it's fairly close:

Contents of /etc/printcap:

    :cm=Helpdesk 3 HP LaserJet 3

Output of "ls -ld /var/spool/lpd/hplj3-remote":

drwx------    2 daemon   lp           1024 Jan  3 11:43 hplj3-remote/

Output of ls -la /var/spool/lpd/hplj3-remote":

drwx------    2 daemon   lp           1024 Jan  3 11:43 .
drwxrwsr-x    5 lp       lp           1024 Nov 13 09:06 ..
-rw-------    1 daemon   lp             60 Dec 11 15:58 .config
-rw-------    1 daemon   lp              0 Nov 26 17:01 .null

Contents of ".config":

.null is simply a "holding place" for a lock file for the "lp=" line in my printcap as per some footnote to a HOWTO I read somewhere along the way.

The real magic apparently takes place in the smbprint file. This file is in the /usr/share/doc/samba-doc/examples/examples/printing/smbprint directory on my box, but I copied it to /etc/samba, although it might more properly go into a /bin directory.

The core magic of this script seems to be this section:
        if [ $TRANS -eq 1 ]; then
          echo translate
        echo "print -"
) | smbclient "\\\\$server\\$service" -U $password -N -P >> $logfile

I'm able to successfully connect to the share/service, but according to the log file (which I set earlier in the smbprint file to be /tmp/smb-print.log) shows this:

SERVER = helpdesk3
SERVICE = zel319hp
added interface ip=xxx.yyy.zzz.qqq bcast=xxx.yyy.abc.def nmask=
Got a positive name query response from xxx.yyy.zzz.dns ( xxx.yyy.zzz.nn )
Domain=[ACU] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
smb: \> smb: \> echo: command not found
smb: \> cat: command not found
smb: \> ): command not found
smb: \> smb: \> echo: command not found
smb: \> smb: \>

In addition to this problem, I haven't been able to find any documentation as to what the option "-P' means, which makes me suspect that the script was written for an older version of samba that no longer works with this script, but being a non-coder, I haven't been able to figure out how to modify the script to work.

In addition, I once got something out of the printer, but I had to force a formfeed at the printer's front control panel to get the page to spit out, and it suffered from the common stair-step problem. When I tried to incorporate magicfilter to compensate, things just got worse, as the documentation I found for that method seems to conflict with the docs for this method, and in trying to figure out how things worked just found that an if filter is apparently not treated as a script, even though it looks (to me) like a script (try creating a "Hello world!" script and then referencing it in the if= line in printcap -- you'd expect to see "Hello world!" when you "print" something, but it never worked for me, so I just got frustrated and gave up, until you asked this question and now I'm playing again -- maybe in another half year I'll have it figured out and can help you then).

I could give up on lprng/magicfilter/samba and just use CUPS, but I'm strapped for memory, and have just barely enough for X and Galeon without any extraneous stuff -- if I ever get it working it'll go into production along with 3 clones as a web-browsing-only kiosk.

So, in summary, I believe it can be done, but good luck!


Reply to: