projects
/
Printer-Zebra.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
document each ZPL command sent to printer
[Printer-Zebra.git]
/
ZPL2pbm.pl
diff --git
a/ZPL2pbm.pl
b/ZPL2pbm.pl
index
860f28b
..
692fb66
100755
(executable)
--- a/
ZPL2pbm.pl
+++ b/
ZPL2pbm.pl
@@
-31,12
+31,11
@@
while( $line ) {
warn "# ~DG$1 => [$name] t=$t w=$w\n";
warn "# ~DG$1 => [$name] t=$t w=$w\n";
- my $data;
- read $in, $data, $t;
+ my $data = <$in>;
my $out;
# ZPL decompress
my $out;
# ZPL decompress
- my $repeat =
1
;
+ my $repeat =
0
;
foreach my $p ( 0 .. length($data) - 1 ) {
my $c = substr($data,$p,1);
if ( $c eq ',' ) {
foreach my $p ( 0 .. length($data) - 1 ) {
my $c = substr($data,$p,1);
if ( $c eq ',' ) {
@@
-44,9
+43,14
@@
while( $line ) {
$l = $w * 2 if $l == 0;
warn "# $p ZERO-to-EOL $c [$l]\n";
$out .= "0" x $l;
$l = $w * 2 if $l == 0;
warn "# $p ZERO-to-EOL $c [$l]\n";
$out .= "0" x $l;
+ } elsif ( $c eq '!' ) {
+ my $l = ( $w * 2 ) - length($out) % ( $w * 2 );
+ $l = $w * 2 if $l == 0;
+ warn "# $p ONE-to-EOL $c [$l]\n";
+ $out .= "F" x $l;
} elsif ( $c eq ':' ) {
$out .= length($out) > $w ? substr($out,-$w*2) : "00" x $w;
} elsif ( $c eq ':' ) {
$out .= length($out) > $w ? substr($out,-$w*2) : "00" x $w;
- warn "# $p
:
\n";
+ warn "# $p
repeat last line
\n";
} elsif ( $c eq 'z' ) {
$repeat += 400;
} elsif ( $c ge 'g' && $c le 'y' ) {
} elsif ( $c eq 'z' ) {
$repeat += 400;
} elsif ( $c ge 'g' && $c le 'y' ) {