Troy Buss ([EMAIL PROTECTED]) wrote on Thu, 21 Apr 2005 11:57:59 -0700

> I have some forms that print to HP printers using standard
> PCL formatting codes.
> ...
> However, when I print direct to the printer, I get a lot of the
> logo in blue, but rectangular portions of the logo in black as
> if the raster portions are ignoring my color selection.

Part of the problem is that the background is defined, and the CMY pallet
uses "0" for white.

> Just wanting to know if someone else out there has
> successfully implemented PCL coloring.

I have managed using Simple Color, but it was a long journey...

In the Simple CMY pallet the colors are as follows:

# Description
- -----------
0 White
1 Cyan
2 Magenta
3 Dark Blue
4 Yellow
5 Green
6 Red
7 Black

<Esc>*r-3U sets the Simple CMY pallet
<Esc>*v#S set color # (0-7)
<Esc>*r1U resets the normal pallet

The following BASIC program will demonstrate printing plain text in color.

PRINTER ON
PRINT "Test Color Printing - Default"
PRINT "Setting CMY Pallet"
PRINT CHAR(27):"*r-3U-->Pallet Set"
PRINT "Setting Colors 0-7"
FOR I = 0 TO 7
   PRINT CHAR(27):"*v":I:"SPrint Test Color # ":I
NEXT I
PRINT "Reset Pallet to B&W"
PRINT CHAR(27):"*r1UPallet Reset"
PRINT "This should be normal color"
PRINTER OFF
PRINTER CLOSE

Graphics are another story.  You can review my article on B&W Logo printing
at www.u2ug.org - click on Topics then Newsletter.  To add color, you must
set the pallet as with the text example above, then export your Cyan,
Magenta and Yellow data layers separately.  To print # bytes of pixel data,
use

<Esc>*b#V[cyan data]
<Esc>*b#V[magenta data]
<Esc>*b#W[yellow data]

You can speed things up by printing 0 bytes of colors you don't need - for
example, to print 5 bytes in Yellow, use

<Esc>*b0V<Esc>*b0V<Esc>*b5W<5 data bytes>

I had problems with certain data values in the data bytes (e.g., 10-15).  I
wound up having to print in two phases (as with the B&W article) but with
different data arrangements.  Off hand, I think I used the low two bits in
each hex digit, then shifted two bits to do the second half of the logo.

We have not put this option into production.  Even though I can get our
two-color logo to display properly, the code is specific to color printers.
The color commands do not adjusted well in our B&W printers.

--Tom Pellitieri
  Century Equipment
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to