in reply to Re^3: send color text to printer
in thread send color text to printer
$COLOR{"0"} = "0 0 0"; $COLOR{"1"} = "0 0 1"; $COLOR{"2"} = "0 1 0"; $COLOR{"3"} = "0 1 1"; $COLOR{"4"} = "1 0 0"; $COLOR{"5"} = "1 0 1"; $COLOR{"6"} = "1 1 0"; $COLOR{"7"} = "1 1 1"; $SY{"0"} = "0"; $SY{"1"} = "1"; $SY{"2"} = "2"; $SY{"3"} = "3"; $SY{"4"} = "4"; $SY{"5"} = "5"; $SY{"6"} = "6"; $SY{"7"} = "7"; $SY{"8"} = "8"; $SY{"9"} = "9"; open OUT, ">test.ps"; print OUT "%!\n"; print OUT "72 72 scale\n"; print OUT ".25 .25 translate\n"; print OUT "/Courier findfont .095 scalefont setfont\n"; $sy1=1; $color=0; for ($y=1; $y<=148; $y++) { $sy = $sy1; $sy1++; if ($sy1 > 9) {$sy1 = 0;} for ($x=1; $x<=130; $x++) { $_x = $x*.060; $_y = $y*.070; print OUT "$COLOR{$color} setrgbcolor\n"; print OUT "$_x $_y moveto ($SY{$sy}) show\n"; $sy++; if ($sy > 9) {$sy=0;} $color++; if ($color > 7) {$color = 0;} } } print OUT "showpage\n"; close OUT; `lp test.ps`;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: send color text to printer
by Aristotle (Chancellor) on Aug 05, 2003 at 21:50 UTC |