Sorry if this prints twice, I neglected to login prior to submitting this question. I think I stopped the previous post before posting.
Hello, I have been using the Term:ANSIColor module to print in color, but I would like to print this color on a printer. A simple redirect to the printer just prints the ANSI escape code. Could someone please let me know the best way to print color.
thanks
J
open(LPR, "|lpr -P agrprt165 >/dev/null 2>&1"); open TMP, ">.tmp"; $COLOR{"0"} = "black"; $COLOR{"1"} = "red"; $COLOR{"2"} = "yellow"; $COLOR{"3"} = "green"; $COLOR{"4"} = "blue"; $COLOR{"5"} = "cyan"; $COLOR{"6"} = "magenta"; $COLOR{"7"} = "white"; $ON_COLOR{"0"} = "on_black"; $ON_COLOR{"1"} = "on_red"; $ON_COLOR{"2"} = "on_yellow"; $ON_COLOR{"3"} = "on_green"; $ON_COLOR{"4"} = "on_blue"; $ON_COLOR{"5"} = "on_cyan"; $ON_COLOR{"6"} = "on_magenta"; $ON_COLOR{"7"} = "on_white"; $SPECIAL{"0"} = ""; $SPECIAL{"1"} = "dark"; $SPECIAL{"2"} = "bold"; $SPECIAL{"3"} = "underline"; $SPECIAL{"4"} = "underscore"; $SPECIAL{"5"} = "blink"; $SPECIAL{"6"} = "reverse"; $SPECIAL{"7"} = "concealed"; $SY{"0"} ="A"; $SY{"1"} ="B"; $SY{"2"} ="C"; $SY{"3"} ="D"; $SY{"4"} ="E"; for ($w=0; $w<8; $w++) { for ($x=0; $x<8; $x++) { for ($y=0; $y<4; $y++) { for ($z=0; $z<5; $z++) { $tmp = "$COLOR{$x} $ON_COLOR{$w} $SPECIAL{$y}"; print colored ("$SY{$z}", $tmp); print TMP colored ("$SY{$z}", $tmp); print LPR colored ("$SY{$z}", $tmp); } print "\n"; print TMP "\n"; print LPR "\n"; } } } close TMP; close(LPR);
edited: Tue Aug 5 17:30:58 2003 by jeffa - code tags, formatting
In reply to send color text to printer by jhasting
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |