Board index » delphi » Some PCL codes not working

Some PCL codes not working

I'm having a problem using some PCL codes.  HP says that if I
send the right codes to the printer, the printer will use them.
For me, some PCL codes work, but others are ignored.  For
instance, the program segment below should print in 15 levels of
stroke weight, from ultra light to ultra bold.  When I tried it
on three PCL printers on three systems, it only printed medium
(for i= -7 to 0) or bold (for i>0).  

Why are most of these codes being ignored? TIA?

var i  : integer;
    st,
    code : string;
    f  : TextFile;

begin
  AssignFile( f, 'LPT1');
  rewrite( f);
  write( f, chr( 27) + 'E'); // reset
  writeln( f, 'printer test');
  writeln( f);

  for i := -7 to 7 do
  begin
    str( i, st);
    code := chr( 27) + '(s' + st + 'B';
    writeln( f, code, ' 15 levels of bold test - level ', i);
  end;

  write( f, chr( 12)); // page eject
  write( f, chr( 27) + 'E');     // reset
  CloseFile( f);
end;

Jud McCranie

 

Re:Some PCL codes not working


Quote
Jud McCranie wrote:

> When I tried it
> on three PCL printers on three systems, it only printed medium
> (for i= -7 to 0) or bold (for i>0).

> Why are most of these codes being ignored? TIA?

Is your question astually that why doesn't HP printer print as it should
do?
I did not take time to check if those 15 levels of thickness need version
3, 5 or new 5.5 version of PCL code. But have you checked that your
printer has the right PCL capability?

The Delphi/Pascal code looks Ok to me. If you have checked that that is
exactly the PCL strings you should send to printer, and it won't work,
then there's not much one can do with Delphi code.

Markku Nevalainen

Re:Some PCL codes not working


Quote
Markku Nevalainen <m...@iki.fi> wrote:
>Is your question astually that why doesn't HP printer print as it should
>do?

Yes.  I've tried it on 3 HP laser printers on three systems, and
none of them print like the PCL documentation says they should.

Quote
>I did not take time to check if those 15 levels of thickness need version
>3, 5 or new 5.5 version of PCL code. But have you checked that your
>printer has the right PCL capability?

It is in the HP 4L user's manual, and when I contacted HP tech
support, they said that if you send it the PCL command, it will
work.  (However, many of them don't).  The HP 4L has PCL5e.

Quote
>The Delphi/Pascal code looks Ok to me. If you have checked that that is
>exactly the PCL strings you should send to printer, and it won't work,
>then there's not much one can do with Delphi code.

Since I posted the message, I sent it to a file, and the file
does contain the PCL codes.  Sending that file to the printer
gives the same results as from the Delphi program, though.

So I'm still at a loss as to why it doesn't work.  I'm probably
going to mail a copy of the output to HP and see what they say.
Jud McCranie

Re:Some PCL codes not working


I played around with the stroke weight commands several years ago without
much luck. I was never able to get it to work the way the documentation
suggests that it should. I suspect that the printer uses the stroke weight
command to make a selection from available fonts as opposed to adjusting the
font to match the asked for stroke weight. Did HP say specifically that
stroke weight should work the way you are trying to use it?

Re:Some PCL codes not working


Quote
"Bruce Roberts" <no.junk.please....@attcanada.net> wrote:
>I played around with the stroke weight commands several years ago without
>much luck. I was never able to get it to work the way the documentation
>suggests that it should.

That's what happened to me.

Quote
> I suspect that the printer uses the stroke weight
>command to make a selection from available fonts as opposed to adjusting the
>font to match the asked for stroke weight.

That might be right - the printer has upright, italics, bold,
and bold italics built in.  I get those with no problem.  I
don't get the other variations though.

Quote
> Did HP say specifically that
>stroke weight should work the way you are trying to use it?

Yes, but I don't think they either didn't understand the problem
or didn't know what they were talking about.  I'm going to mail
them sample output.

Jud McCranie

Other Threads