Menu

#4 Incomplete printouts

open
nobody
None
5
2012-09-14
2002-10-02
No

I have a Samsung 1650N printer. I use it with the tcp
interface, port 9100. The problem that I was seeing is
that printouts would look great, except they were
missing the bottom part of the printout. For example, a
printout from Mozilla would print the top part of
Google.com, but the printout would stop right at the
search query line. The bottom part that says "Advertise
with us" and the copyright line would not be a part of
the printout.

I downloaded the source code and worked through it
until I got to the /etc/pdq/interfaces/tcp-port-2.0
script. I replaced the perl code in
there with the command line utility 'nc'.

It now has the send-exec line:

send_exec {cat $INPUT | nc -q2 $REMOTE_HOST $REMOTE_PORT
}

This works perfectly, leading me to believe that
something is wrong
with the Perl script that it doesn't send everything to
the printer properly.

BTW, I have noticed the same problem on an HP8000
printer that I use at work, so I don't think it depends
on the specific printer. I'll do more testing tomorrow
morning to see if the HP8000 does the same thing when I
send it postscript instead of PCL.

Anyway, thanks for the sweetest printing solution that
I have found for
Linux. I want to help fix this bug if I can.

Discussion

  • Patrick Draper

    Patrick Draper - 2002-10-02

    Logged In: YES
    user_id=7387

    I've verified that the bug exists on the HP8000 here at
    work. I'm using a different driver because the HP8000 speaks
    postscript, thus the gs program is not needed in the chain.
    In this case the same fix as I mentioned above works. I
    susped that there is indeed a problem with the perl program
    to send a file to a network port. I'll do some more testing
    with the perl program to see if I can fix it. I don't know
    perl, so I can't make any guarentees, but I'll try.

     
  • Patrick Draper

    Patrick Draper - 2002-10-02

    Logged In: YES
    user_id=7387

    It's FIXED! The problem with the Perl code is that it only
    sends data. The PCL file I was printing had some kind of
    problem with the fonts where the printer had to substitute a
    different font. It sends data back over the TCP connection
    as a notification of the substitution. The perl program was
    never reading the port after it wrote the data, so the
    printer had a timeout error when the socket was closed.

    The fix is simple. At the end of the Perl program, just add
    a line that says <SOCK>; so that the socket is read just
    before it is closed. The end of my program now looks like this:

    while (<INPUT>) {
    print SOCK;
    }
    <SOCK>;
    close (SOCK) || die "socket close: $!";
    close (INPUT) || die "file close: $!";
    exit;
    }

    This code now works as it is expected to.

     

Log in to post a comment.