Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Changing text color

Changing text color

Changing text color

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.


RE: Changing text color

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

RE: Changing text color

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).

RE: Changing text color

Just seeing if you were paying attention! winky smile  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

RE: Changing text color

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?


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

RE: Changing text color

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

RE: Changing text color

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.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close