I know it's not pretty, but it works nicely for me
Update: I included a couple of the resources I used to figure out the PJL syntax and commands used in the script.
C-.
HP site link 1use IO::Socket; my $host = 'INSERT IP HERE'; my $port = '9100'; #jet direct port my $eoln = "\x0A"; $msg = 'Insert $0.25 and Press Go to Continue'; my $sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port, Proto => 'tcp'); die "Couldn't connect to $host on $port: $!\n" unless $sock; print "Connected\n"; $printer{"escapeseq"} = chr(27) . "%-12345X\@PJL"; $printer{"input"} = "\@PJL OPMSG DISPLAY= \"$msg \" $eoln"; $printer{"last"} = "\x1B&k3G"; foreach $key (sort(keys %printer)){ if ($key eq "escapeseq"){ syswrite($sock, $printer{$key}, $len); }else{ my $len = length $printer{$key}; unless(syswrite($sock, $printer{$key}. chr(27), $len) == $len) + { $sock->close; print "Server unexpectedly closed connection\n"; last; } } }
and you can do a search on google for 12345x@pjl
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: HP Jet Direct Control
by Desdinova (Friar) on Jun 15, 2001 at 01:51 UTC | |
by cacharbe (Curate) on Jun 15, 2001 at 06:19 UTC | |
Re: HP Jet Direct Control
by raven67 (Initiate) on Nov 27, 2001 at 04:00 UTC | |
by cacharbe (Curate) on Nov 27, 2001 at 04:49 UTC |