Dear all, I have two pcs, one is installed Linux Redhat7.2, which including samba2.2.1. the other pc is instaled W2K, which connected a HPDeskjet970 printer. I want to print to HPDeskjet from Linux side with samba. I use smbclient //biopc/HPDJ970C -U administrator to print some file. The print result give me some starircase. the printed is like: this is a example for samba line 1 this is line2 this is line3 this is line4 (it should be : this is a example for samba line 1 this is line2 this is line3 this is line4 ) And the smaba manual said we should add an entry for the remote printer. I did it and use a filter for this problem, it seems that the filter does not work. I am attaching my smb.conf and printcap file, does anybody give some ideas, thank you very much in advance. # Global parameters [global] workgroup = bioinfo netbios name = HERA encrypt passwords = Yes update encrypted = Yes log level = 6 log file = /tmp/log.smbd.1219 max log size = 1000 socket options = TCP_NODELAY IPTOS_LOWDELAY wins support = Yes # oplocks = Yes # disable spoolss = No [homes] browseable = No map archive = yes [hp2100] printable = Yes path = /var/spool/samba print command = /usr/bin/lpr -Php2100 %s # print command = cat %s > /home/qgu/showus printer = hp2100 guest ok = Yes min print space = 2000 # browseable = Yes # read only = No # printing = lprng printing = BSD # use client driver = Yes printer driver = HP LaserJet 2100 Series PS [qingjuan] comment = For testing only, please path = /export/samba/qingjuan guest ok = Yes read only =no # include = /usr/local/samba/lib/smb.conf. Printcap file: hp2100|lp0:\ :sh:\ :ml=0:\ :mx=0:\ :sd=/var/spool/lpd/hp2100:\ :af=/var/spool/lpd/hp2100/hp2100.acct:\ :lp=|/usr/share/printconf/util/jetdirectprint:\ :lpd_bounce=true:\ :if=/usr/share/printconf/util/mf_wrapper: HPDJ970C:\ :rm=biopc:\ :rp=HPDJ970C:\ :sh:\ :if=/var/spool/samba/filter.pl:\ :sd=/var/spool/samba: __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/
qingjuan gu wrote:> Dear all, > > I have two pcs, one is installed Linux Redhat7.2, > which including samba2.2.1. the other pc is instaled > W2K, which connected a HPDeskjet970 printer. I want to > print to HPDeskjet from Linux side with samba. I use > > smbclient //biopc/HPDJ970C -U administrator > > to print some file. The print result give me some > starircase. the printed is like: > > this is a example for samba line 1 > this is line2 > this is line3 > this is line4 > > (it should be : > this is a example for samba line 1 > this is line2 > this is line3 > this is line4 > ) > And the smaba manual said we should add an entry for > the remote printer. I did it and use a filter for > this problem, it seems that the filter does not work.Your output is because Linux uses LF to terminate a line, whereas Windows (and your printer), uses CRLF. So, you need to filter the file to be printed. You can either prepend the HP escape code to translate LF as CRLF, or filter your input file (via smbprint) to perform the translation. Read smbprint (it's a shell script around smbclient). There's an option you can specify to do the translation (I think it's echo translate). Ken Cobler
you want to read about print filters, try this link: http://linux.nf/stepbystep.html One there search under filters hammer. This is a good discussion of print filters (I wrote it!) Joel
Or you may just try the gui of the RH printer setup: There should be a check-box to change the behaviour of your print filter to avoid the "staircase". May be print an ASCI-Testpage from there: It should have the info on it. Christian> you want to read about print filters, try this link: > > http://linux.nf/stepbystep.html > > One there search under filters hammer. This is a good discussion of > print filters (I wrote it!) > > Joel > > > -- > To unsubscribe from this list go to the following URL and read the > instructions: http://lists.samba.org/mailman/listinfo/samba >_(_)_ wWWWw _ @@@@ (_)@(_) vVVVv _ @@@@ (___) _(_)_ @@()@@ wWWWw (_)\ (___) _(_)_ @@()@@ Y (_)@(_) @@@@ (___) `|/ Y (_)@(_) @@@@ \|/ (_)\ / Y \| \|/ /(_) \| |/ | \ | \ |/ | / \ | / \|/ |/ \| \|/ jgs|// \\|/// \\\|//\\\|/// \|/// \\\|// \\|// \\\|// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Or before piping to lpr, pipe through todos first e.g. someserver$ cat /etc/resolv.conf | todos | lpr If this works, you should be able to modify the print command in smb.conf At 08:32 AM 1/16/02 +0100, you wrote:>Or you may just try the gui of the RH printer setup: There should be >a check-box to change the behaviour of your print filter to avoid the >"staircase". May be print an ASCI-Testpage from there: It should have >the info on it. > >Christian > > > you want to read about print filters, try this link: > > > > http://linux.nf/stepbystep.html > > > > One there search under filters hammer. This is a good discussion of > > print filters (I wrote it!) > > > > Joel > > > > > > -- > > To unsubscribe from this list go to the following URL and read the > > instructions: http://lists.samba.org/mailman/listinfo/samba > > > > > _(_)_ wWWWw _ > @@@@ (_)@(_) vVVVv _ @@@@ (___) _(_)_ > @@()@@ wWWWw (_)\ (___) _(_)_ @@()@@ Y (_)@(_) > @@@@ (___) `|/ Y (_)@(_) @@@@ \|/ (_)\ > / Y \| \|/ /(_) \| |/ | > \ | \ |/ | / \ | / \|/ |/ \| \|/ >jgs|// \\|/// \\\|//\\\|/// \|/// \\\|// \\|// \\\|// >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >-- >To unsubscribe from this list go to the following URL and read the >instructions: http://lists.samba.org/mailman/listinfo/samba=============Martyn Ranyard
Hello, Thank you very much for your information. I finally solve the staircase problem. I use a script filter.pl as a input filter. But I still have another problem. After I send the command to the printer, the printer will flash a red light, it SEEMS that it is waiting feed form. I have push this button before the paper comes out. I have tried use sf, ff, ff_separator and eot, they all do not work. Does anybody have idea or experience this problem. Here is my print cap file: HPDJ970C:\ :sh:\ :ff:\ :eot:\ :ff_separator=false:\ :ml=0:\ :mx=0:\ :sd=/var/spool/lpd/HPDJ970C:\ :af=/var/spool/lpd/HPDJ970C/HPDJ970C.acct:\ :lp=|/usr/share/printconf/util/smbprint:\ :if=/var/spool/samba/filter.pl: --- Christian Barth <barth@cck.uni-kl.de> wrote:> Or you may just try the gui of the RH printer setup: > There should be > a check-box to change the behaviour of your print > filter to avoid the > "staircase". May be print an ASCI-Testpage from > there: It should have > the info on it. > > Christian > > > you want to read about print filters, try this > link: > > > > http://linux.nf/stepbystep.html > > > > One there search under filters hammer. This is a > good discussion of > > print filters (I wrote it!) > > > > Joel > > > > > > -- > > To unsubscribe from this list go to the following > URL and read the > > instructions: > http://lists.samba.org/mailman/listinfo/samba > > > > > _(_)_ wWWWw > _ > @@@@ (_)@(_) vVVVv _ @@@@ (___) > _(_)_ > @@()@@ wWWWw (_)\ (___) _(_)_ @@()@@ Y > (_)@(_) > @@@@ (___) `|/ Y (_)@(_) @@@@ \|/ > (_)\ > / Y \| \|/ /(_) \| |/ > | > \ | \ |/ | / \ | / \|/ |/ \| > \|/ > jgs|// \\|/// \\\|//\\\|/// \|/// \\\|// \\|// > \\\|// >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/