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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combined command w/ data 2

Status
Not open for further replies.

srwatson

Programmer
Dec 13, 2011
16
0
0
CA
I was wondering if some printers allow PCL commands with data to be combined. For example could the following

Ec *r1A
Ec *b0M
Ec *b2M__
Ec *b2M__
Ec *rC

Be written as

Ec *r1A
Ec *b0M
Ec *b2m2M____
Ec *rC

I wasn't sure if the printer would read the first two bytes of data following the terminator and associate it with the first command and then read the last two bytes of data and associate it with the second command.

I tried simulating this with a small 4x4 image using a PCL viewer. The viewer ignored the binary data that followed the terminator. Is this behavior that I should expect with most/all printers?

If so what other scenarios will prevent a PCL command from being combined (provided the commands meet the three defined rules written in the specification).
 
Your sample, of the format:

<esc>*b2m2Mpqrs

where 'pq' and 'rs' are the two sets of 2-byte binary data values required, is NOT valid.

The correct format, according to the syntax rules, would be:

<esc>*b2mpq2Mrs

Early LaserJet devices did not support the use of binary data associated with the 'not last' (I sure there is a better way of expressing that!) parts of combination sequences, so that (syntactically-valid) format would not be interpreted correctly.

I suspect that modern devices DO support this, but I don't know for certain.
 
But, but, but...

the b2m part is the compression scheme, NOT the byte count.

so <esc>*b2m2Wpq<esc>*b2Wrs would be the correct sequence.

You don't have to repeat the compression sequence if it hasn't changed since the last sequence.


Jim Asman
 
Jim

You are quite right (as usual)!

I lazily assumed, without checking (given the context in the question), that the sequence (<esc>*b#M) was one where # defined the length of the following binary data, and that the question was about whether you could have binary data associated with more than one element of a combination sequence.

i.e. something like (using your suggested 'Transfer Raster Data by Row/Block' sequence):

<esc>*b3wxxx5Wyyyyy

where 'xxx' and 'yyyyy' represent, respectively, 3-byte and 5-byte binary sequences.

This is (theoretically) valid PCL, although the format wasn't supported by the older LaserJet printers; it may or may not be supported by modern LaserJet devices (I'm not sure).


Chris
 
OK, just to wrap this up.

I made a pcl file without compression. Then I made a second file by editing the first one doing some gloabal deletes and replaces so we have a correct abbreviated file as proposed.

The result...

Both files display perfectly using Swiftview.

However, the edited version of the file resulted in garbage when directed to each of my 3 different PCL5 printers...
LJ4+, LJ5000, and DJ2280


Jim Asman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top