Term::ANSIColor How can I print the color directly to a printer

J

Joe Hasting

I have been using Term::ANSIColor to have printed charaters on my screen,
how can I direct the ANSI escaped code to a color printer directly and have
it print in color (not print the ANSI escape codes). I tried the simple
code below. The first page comes out ok, but the second page is printed
with the escape codes. Thanks J

--------------
31;40mtest
0m32;41mtest
0m
----------------

use Term::ANSIColor;

open(LPR, "|lpr -P agrprt166 >/dev/null 2>&1");
print LPR "test\n";
print LPR "test\n";
close(LPR);

open(LPR, "|lpr -P agrprt166 >/dev/null 2>&1");
print LPR colored ("test\n", "red on_black");
print LPR colored ("test\n", "green on_red");
close(LPR);
 
G

Greg Schmidt

I have been using Term::ANSIColor to have printed charaters on my screen,
how can I direct the ANSI escaped code to a color printer directly and have
it print in color (not print the ANSI escape codes). I tried the simple
code below. The first page comes out ok, but the second page is printed
with the escape codes. Thanks J

Does your printer support ANSI escape sequences? Does any printer?
Unless there is another module that handles this, I think you may have
to learn the printer-specific codes or else use PostScript or PCL or
some other standard that your printer understands.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top