×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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!
  • Students Click Here

*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

Jobs

Changing colors

Changing colors

Changing colors

(OP)
I'm having a difficult time changing the color of one word in a line of text from black to some color, can someone help me understand what's happening in the following examples?
I'm using a HP Business InkJet 1200

Thanks,
Wood

I've add my own comments after the ";"

----- test 1 -----
this is black<esc>*r-3U<esc>*vSCyan<esc>*r1U
<esc>*r-3U<esc>*v6SRed <esc>*r1U<esc>*v1SBlack
<esc>*r-3U<esc>*v3SBlue <esc>*r1U<esc>*v1SBlack

Result:                   my comments
this is black Cyan       ;in correct colors
Red Black                ;in correct colors
Blue Black               ;in correct colors

-------end of test 1 ---------

----- test 2 -------
this is black<esc>*r-3U<esc>V1SCyan<esc>*r1U
<esc>*r-3U<esc>*v6SRed <esc>*r1U
<esc>*r-3U<esc>*v3SBlue <esc>*r1U<esc>*v1SBlack

Result:
this is black Cyan       ;in correct colors
                         ;blank line
Blue Black               ;in correct colors

---- end of test 2 ----

----- test 3 -----
this is black<esc>*r-3U<esc>V1SCyan<esc>*r1U
<esc>*r-3U<esc>*v6SRed <esc>*r1U<esc>*v1S
<esc>*r-3U<esc>*v3SBlue <esc>*r1U<esc>*v1SBlack

Result:
this is black Cyan       ;in correct colors
                         ;blank line
Blue Black               ;in correct colors

-------end of test 3 ---------


----- test 4 -----
this is black<esc>*r-3U<esc>V1SCyan<esc>*r1U
<esc>*r-3U<esc>*v6SRed <esc>*r1U<esc>*v1S.
<esc>*r-3U<esc>*v3SBlue <esc>*r1U<esc>*v1SBlack

Result:
this is black Cyan       ;in correct colors
unreadable line          ;line the height of the "."
Blue Black               ;in correct colors

-------end of test 4 ---------

RE: Changing colors

You appear to be saying that:

Test1: prints as you expect.
Test2: prints as you expect.
Test3: second line is blank rather than "Red"
Test4: second line is unreadable because height is very small

Am I interpreting you correctly?

General point: you appear to be relying upon LineFeed (0x0a) characters (perhaps in conjunction with CarriageReturn (0x0d) characters) to move from line to line.

These lines SHOULD be spaced according to the current Vertical Motion Index (VMI) value.
This can be changed explicitly by several commands, but not any of the sequences you have mentioned.

So I can't explain your symptoms, given the evidence you have presented so far; have you 'missed out' any sequences in your examples, for clarity?

I prefer to position the cursor explicitly, rather than using <CR><LF> with VMI; there are sequences available to allow positioning by row (at current VMI setting), decipoint or PCL unit (at current PCL units per inch setting).

Another general point: I assume that you are switching between the CMY palette, and the monochrome palette, because the BLACK in the CMY palette is a composite (multi-colour) whereas the BLACK in the monochrome palette perhaps uses only the black cartridge? [I don't know, as I have no direct experience of Inkjet devices.]

RE: Changing colors

(OP)
DansDadUK:  Thanks for your analysis.
test1: prints as I expect.
test2: I don't understand why I'm getting a blank line
       instead of "Red"

       I had expected the escape sequence:
       <esc>*r-3U
       to select the CMY palette, and

       <esc>*v6SRed
       to change the current color to red, and then print
       the word "Red" in red ink, and

       <esc>*r1U<esc>*v1S
       to change back to the monochrome palette and select
       black.

       Why is the 2nd line blank instead of printing the
       word "Red"??

As far as the <cr><lf> cursor positioning, this is an old program that was set up to print factory work orders on a line printer, ie: print a line of text, do a <cr><lf> and print another line of text, and eventually a <page eject> at the bottom of the page, etc.  Several years ago, I "bolded" some of the text by surrounding it with PCL escape sequences (eg: <esc><bold>TEXT<esc><normal>).  Now I've been asked to change the color of the text as well. I had hoped I would be able to use the same technique of adding an escape sequence to change the color before the selected text and then a following escape sequence to change the color back to black; eg:
   <esc><ChangeColorToRed>TEXT<esc><BackToBlack>

and end up with a work order that looks like the current one, except all the part numbers are now red.

RE: Changing colors

Sorry; I should have said:

Test1: prints as you expect.
Test2: second line is blank rather than "Red"
Test3: second line is blank rather than "Red"
Test4: second line is unreadable because height is very small

but my eye was deceived by the very similar constructs for tests 2 and 3.

Another point which I didn't mention before was that the first line of each test as shown contained either <esc>*vSCyan or <esc>V1SCyan, which I assumed were both 'typos' (and should have been <esc>*v1SCyan), otherwise you would not have got Cyan on the first line.

I still can't explain your symptoms, given the information that you've provided so far.

[I assume that Inkjet1200 devices (with which I've no experience) do properly understand PCL5c colour sequences, as would be understood by a LaserJet device.]

If you can 'print to file' a sample of your output "text + embedded PCL", send it to "DansDad at btinternet dot com" and I'll see if that gives any more clues; bear in mind that mailbox gets a lot of (filtered) spam, so I might not get it!

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