Printer

Joel Hammer Joel at HammersHome.com
Wed Jan 23 17:16:26 GMT 2002


On Wed, Jan 23, 2002 at 06:57:14PM -0300, Supervisor wrote:
> My printer is a HP LaserJet 4000N Series PCL6, yes it's postscript, the
> command that you gave almost work it because it only print like the first
> line of the document.

Believe it or not, using this print command in netscape, I can print to
a samba shared print queue "text" on server "hammer2".

cat  | smbclient  //hammer2/text   -N -c "print -"  

According to this link:

http://www.linuxprinting.org/show_printer.cgi?recnum=100576

this is a postscript printer and you don't need a special driver. So,
the command above should work for your printer.  You just need to fill
in your particulars.  If you want to print other types of documents,
like text, you may have to run the document through other filters before
it goes to smbclient.  For example, to print a text file:

cat  | enscript -Z -B -p - | smbclient  //hammer2/text   -N -c "print -"  

should work. This will work with both text and postscript files.
Of course, if this does work, I would make this into a one line script
called mylpr or some such and invoke it like that.  To just print a
file on your harddrive, I suspect that cat File | mylpr would work,
although input and output redirection can get tricky, for me, and I
haven't tried this.

Now, you can put all of this into a print queue on your client, and just
use the lpr -PYourqueue command to run the print job, but, I am trying
to keep this simple.

Joe





More information about the samba mailing list