raw (binary win95 printer driver) printing gives gibberish

raw (binary win95 printer driver) printing gives gibberish

Post by Jon Sundquis » Thu, 15 Apr 1999 04:00:00

Samba 2.0.3 setup and works perfectly.  Actually, the network is between
Linux and Win95 running in a virtual machine with vmware.  Everything
I've seen this do so far indicates it is just like a normal network
connection.  I can even print quite well using a postscript driver to my
lp share, where the filter runs it through ghostcript (although I do
have that * "lastpage" extra page problem others have had and
changing to the AdobePS driver solved it only to add an extra *first*
page announcing "Aladdin Ghostscript")

But I digress.  Although PS printing works well, 'cept the extra page, I
want to print using the Win95 driver, sending the binary data through a
"raw" printer share. I followed the directions in printer.txt, but the
output was garbage.  I tried both with the stock Win95 driver, and an
updated driver from Canon (it's a BJC-600).  Both these drivers work
right under native windows.

I want to use the win95 print driver since some colors and line weights
of some graphics printing look different going through ghostscript than
from the native driver.  Probably the PS colors and line weights are
more accurate, but I like the "other" output better!

linux:~$ cat /etc/printcap
# /etc/printcap
# Please don't edit this file directly unless you know what you are
# Be warned that the control-panel printtool requires a very strict
# Look at the printcap(5) man page for more info.
# This file can be edited with the printtool in the control-panel.

##PRINTTOOL3## LOCAL bjc600 360x360 letter {} BJC600 24 {}


excepts from /etc/smb.conf (it's in /etc, I used a RH RPM)

# Samba config file created using SWAT
# from localhost (
# Date: 1999/04/14 16:35:39

# Global parameters
        workgroup = MYGROUP
        netbios name = LINUX
        server string = Samba Server
        log file = /var/log/samba/log.%m
        max log size = 50
        socket options = TCP_NODELAY
        domain logons = Yes
        os level = 255
        preferred master = Yes
        domain master = Yes
        dns proxy = No
        hosts allow = localhost,
        hosts deny = ALL

        comment = Home Directories
        read only = No
        browseable = No

        comment = All Printers
        path = /var/spool/samba
        print ok = Yes
        browseable = No


        comment = bubblejet
        path = /tmp
        print ok = Yes

        path = /tmp
        read only = No
        print ok = Yes
        print command = lpr -b -P%p %s
        printer name = raw
        oplocks = No
        share modes = No

Note, I didn't add the oplocks and share modes entries.  SWAT added
those when I went to detailed view to edit the print command.  I don't
think this matters, though.

I don't have a permissions problem, since things are printing.  It's
just that it is printing garbage.

Evidently, the printer is not recognizing the binary data being sent to
it as the stuff it can handle to print a page.  Is Samba adding
something to the the file to*up the printer's recognition of the
printer file?  I printed to a file in windows, and the first line in a
hex editor matched that of the binary file in the raw spool directory:

from c:\temp\bjc-test.prn :

1b5b 4b02 0000 0f1b 2861 0100 011b 2863

from /var/spool/lpd/raw/dfA004Aa01003 :

1b5b 4b02 0000 0f1b 2861 0100 011b 2863

But copying the printer file into linux, I see:

linux:~$ ls -la ~/tmp/bjc-test.prn
-rwxrwxrwx   1 root     root       133997 Apr 14 23:02

linux:~$ ls -la /var/spool/lpd/raw/dfA004Aa01003
-rw-rw----   1 kde      root       135143 Apr 14 23:10

So obviously something has changed from when the printer file was
generated in windows and when it got spooled in linux.  Running diff
doesn't work on binary files oter than to tell me they are different.

Any ideas?

Jon Sundquist