[Samba] printing fails

Joel Hammer Joel at HammersHome.com
Sat May 11 16:38:01 GMT 2002


When you say you tried it and it doesn't work, what exactly did you do?
Show me your /etc/printcap, your filter file, tell me what happened when
you tried to print, what is in status.winlp or whatever. And, you did run
checkpc -f and stopped and started lpd?
Are you getting unformatted garbage on the printer?

Joel

On Sun, May 12, 2002 at 01:30:09AM +0200, Stefan Schilling wrote:
> Hi!
> 
> I´ve tried it, but it doesnt work...
> 
> What may be wrong?
> 
> Stefan
> 
> 
> Am Samstag, 11. Mai 2002 um 17:32 schrieb Joel Hammer:
> 
> > Sorry about the long delay. I was having trouble getting my filter to do
> > anything. Finally hacked it.
> 
> > I can't give you an exact solution, since I am not currently letting my
> > printer hang off a windows box. It attaches to my linux box. However, I do
> > have my samba server doing more or less the same thing as a windows server.
> 
> > Here is the sort of thing you need. First, you need a queue on your
> > linux box to accept jobs from the windows box. I can't give you the book
> > solution, since I am not using the book. 
> 
> > First, in your printcap, something like this:
> > winlp:\
> >         :sd=/var/spool/lpd/winlp\
> >         :if=/var/spool/lpd/winlp/filter\
> >         :lp=/dev/null:\
> >         :sh:mx#0                         
> 
> > Run checkpc -f and /etc/rc.d/init.d/lpd stop and start after you change
> > /etc/printcap.
> 
> > The filter won't have to to be much, since it will just be the command to
> > send the file to your windows box with the printer.
> 
> > The command:
> > cat PrintFile | smbclient //windowsserver/printer -c "print -" 
> > works fine from the command line but I cannot get it to work from within my
> > filter, so, here is a print filter that works:
> 
> > #!/bin/bash
> cat - >> output
> > /usr/bin/smbclient //windowsserver/printer -N -c "print output"
> 
> > Put this into your spool directory, chmod +x filter.
> > You might want to run checkpc -f, but that isn't necessary I think.
> 
> > This takes a file you have already formatted for your printer and sends
> > it to the windows server, avoiding password prompts. You can embellish
> > this filter, a lot. I would put in rm output just to avoid problems.
> 
> > If you want to learn about print filters, I have attached a postscript file
> > for your perusual which I think is a fine introduction.
> 
> > I would also study smbprint, supplied with your distro, likely. When you
> > figure out the print command in it, please tell me how it works.
> 
> > Joel
> 
> 
> >> Guten Tag Joel Hammer,
> >> 
> >> Am Samstag, 11. Mai 2002 um 13:53 schrieb Joel Hammer:
> >> 
> >> > I assume that the printer is not a postscript printer.
> >> 
> >> > Do you realize that you will need (usually) two queues on your samba
> >> > server? One will be a queue which will filter the print job (the jobs
> >> > sent directly from the samba server in postscript) and a second queue which will simply
> >> > passthrough the print job to the windows printer share.
> >> 
> >> > If you have a queue with a good filter which handles postscript files
> >> > (originating from your samba server) for your printer, you can use that
> >> > queue for all your printing. You could install a postscript driver on your
> >> > windows boxes (HP laserjet3 plus seems to work fine) and send these postscript
> >> > formatted jobs to the same queue as you use for jobs originating on the
> >> > samba server.
> >> 
> >> > I know all this stuff because I have never had success using those
> >> > GUI printer installation programs.
> >> 
> >> > Joel
> >> 
> >> Hi!
> >> 
> >> Thanks for this suggestion! But I wanted to let the sending Win98
> >> box prepare the data to be printed. If that´s too complicated:
> >> all right: how can I do this?




More information about the samba mailing list