From Linux to W2K

Ken Cobler kcobler at coblercorp.com
Tue Jan 15 15:54:05 GMT 2002


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





More information about the samba mailing list