Operating System - HP-UX
1832852 Members
3210 Online
110047 Solutions
New Discussion

Re: HP printer control sequence

 
O'lnes
Regular Advisor

HP printer control sequence

does any one know where can i know how to setup HP printer control sequence?
Andy
5 REPLIES 5
Michael Tully
Honored Contributor

Re: HP printer control sequence

Hi,

Do you mean to create a print queue? If so use either 'sam' or have alook at the man page for 'lpadmin'

Michael
Anyone for a Mutiny ?
O'lnes
Regular Advisor

Re: HP printer control sequence

No, I want to use the HP printer control code ( eg. /027E/027&l0O ) to control the printout such as size , font etc.

Andy.
Andy
Olav Baadsvik
Esteemed Contributor

Re: HP printer control sequence


Hi,

To add printer-control commands to the
print-job you must edit the model-script
for the printer. The model-script to
edit is found in /etc/lp/interface.
It has the same name as the queue-name for
the printer.
You will see that most model-scripts have
a lot of options (passed by using -o option
in the lp command)
It could be that what you are looking for
already is covered by an option.

Regards
Olav
Robert de Mander
New Member

Re: HP printer control sequence

Perhaps this will help!

First, getting PCL escape commands into a file, plus some examples:

The command that the printer needs for formatting or, adding carriage returns to
line feeds, is the PCL string:
&k2G

ksh: print -n "\033&k2G" > afile

Inserted at the beginning of the ASCII text file, this will eliminate stair stepping.

Resetting printer:
E

ksh: print -n "\033E" > bfile

At the end to ensure that following jobs won't get fooled!

more pcl control codes (to combine codes use lower case on the final char):
portrait &l0O
landscape &l1O
symbol set ISO 8859-1 (0N

font courier (s4099T
font arial (s16602T
font times (s16901T

primary pitch (s##H

Then I wrote a simple wrapper script (attached) that feeds lp the control codes and the file(s) to print. Not the worlds most elegant solution - but it works!

Robert

Andreas Voss
Honored Contributor

Re: HP printer control sequence

Hi,

have a look at /usr/lib/lp/model/PCL5

There you can find many PCL escape sequences.
They are used with echo "\033&...."
The \033 represents the escape char in octal value (hex: 1b)

Regards