Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing text color 1

Status
Not open for further replies.

bigwood177

Programmer
Nov 20, 2002
5
US
I'm changing the font of text on a client's workorders by embedding PCL commands; now they want to change the color of certain words as well. I'm not a PCL expert by any means, and the documentation I've read regarding *color* is much more complicated than that regarding *font*. If anyone could point me in the right direction it would be much appreciated.

Thanks,
Wood
 
If you are just looking for primary colors try something like...

This is black <esc>-r3U<esc>*v6SThis is red <esc>*v1SBlack again

If that doesn't work, let me know. PCL5c will let you define colors precisely. See the color manual for setting up the color definitions and the index to reference them.




Jim Asman
 
I suspect that Jim meant to tell you to use either:

BLACK<esc>*r-3U<esc>*v6SRED<esc>*v7SBLACK AGAIN

which uses the simple-colour CMY palette, or:

BLACK<esc>*r3U<esc>*v1SRED<esc>*v0SBLACK AGAIN

which uses the simple-colour RGB palette.

The default simple-colour monochrome palette (which can be explicitly selected using <esc>*r1U) enables White (<esc>*v0S) or Black (<esc>*v1S) to be selected, so the CMY palette is more 'compatible' with the monochrome palette (in that both use '0' to indicate White); the '7' for Black in CMY results in 7mod2=1=Black in the monochrome palette).
 
Just seeing if you were paying attention! ;-) I should have looked it up. Thanks for catching it.

I usually use a palette where you can fully define the colour, permitting more subtle colours than the simple palette akllows.

Jim Asman
 
Thanks guys, I appreciate your help.

DansDad: I used the code in your example. The red came out in red, but the "black again" comes out purple. Also, if I write seven lines to my output file (changing the color index from 1 thru 7) only the first line prints. In fact, no matter what the contents of my output file are, nothing prints after the first line. Any suggestions?

Thanks,
Wood

contents of output file:
BLACK<esc>*r-3U<esc>*v6SRED<esc>*v7SBLACK AGAIN
BLACK<esc>*r-3U<esc>*v1SCyan<esc>*v7SBLACK AGAIN
BLACK<esc>*r-3U<esc>*v2SMagenta<esc>*v7SBLACK AGAIN
etc
 
You probably have a typo in there. That should work.

You only need to type in the <esc>*r-3U once at the beginning of the job. Try...

<esc>*r-3U<esc>*v1SCyan<esc>*v2SMagenta<esc>*v3SBlue etc.

Purple shouldn't be possible with the simple palette.
What kind of printer are you using? It almost sounds like a composite black gone wrong.

FYI, composite black is made up using the C+M+Y colour dyes rather than the black ink/toner.

Jim Asman
 
Thanks Jim. The colors all work - as long as they are all contained in one long string per your example. If I "send" a file to the printer containing more than one line, for example if I duplicated the string in your message 4 times, only the first line prints - the rest of the page is blank. Each line is terminated by a CRLF. I'm using a HP Business Jet 1200 printer.

Wood
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top