From: Dobrica Pavlinusic Date: Sun, 5 Feb 2012 18:21:47 +0000 (+0100) Subject: implement ! fill one to end of line compression X-Git-Url: http://git.rot13.org/?p=Printer-Zebra.git;a=commitdiff_plain;h=19ea357698992dfea94dfc919c6efe22917b4a7c implement ! fill one to end of line compression --- diff --git a/ZPL2pbm.pl b/ZPL2pbm.pl index 860f28b..e439ae4 100755 --- a/ZPL2pbm.pl +++ b/ZPL2pbm.pl @@ -44,6 +44,11 @@ while( $line ) { $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 .= "1" x $l; } elsif ( $c eq ':' ) { $out .= length($out) > $w ? substr($out,-$w*2) : "00" x $w; warn "# $p :\n";