1822708 Members
3688 Online
109644 Solutions
New Discussion юеВ

Printing Problem

 
SOLVED
Go to solution
Clint Gibler
Frequent Advisor

Printing Problem

I have an old program that prints labels in unix and uses this escape code sequence to get the spacing right.

^[E^[&s1C^[&a-2R^[&l6D^[(s0p12.7h18v0s6b4099T

however I had to put in a new printer and now they print landscape instead of Portrait. The printer is an HP laserjet 2820 and I can't get it to print landscape and do the proper spacing can somebody help me to change this to the correct sequence?
7 REPLIES 7
Mel Burslan
Honored Contributor

Re: Printing Problem

Clint,

What you are asking is something next to impossible. The only thing I can suggest is to find the programming for your old printer, which by the way you did not mention, decode what this escape string does out of the programming codes. Find the same manual for HP LJ2820 and match the functions one by one. I am assuming by looking at the code, this is some incarnation of PCL and should not be too hard to decode. Just figure out which PCL version your old printer used and look for programming manuals over the web. You should not have anmy difficulty finding it.
________________________________
UNIX because I majored in cryptology...
Rodney Hills
Honored Contributor

Re: Printing Problem

The escape sequence for landscape in PCL is-
^[&l1O

HTH

-- Rod Hills
There be dragons...
Clint Gibler
Frequent Advisor

Re: Printing Problem

It already prints landscape for some reason I need it to print portrait. I can't find the escape codes anywhere for this printer.
Rodney Hills
Honored Contributor

Re: Printing Problem

The escape sequence for portrait in PCL is-
^[&l0O

Here is a web site that describes PCL-
http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&cc=us&objectID=bpl04632

HTH

-- Rod Hills
There be dragons...
Bill Hassell
Honored Contributor
Solution

Re: Printing Problem

If the printer is printing a simple ASCII file (such as /etc/profile) in landscape mode using the lp command with *no* options, then someone has violated the most important rule for network or shared printers: NEVER change the printer's front panel settings!!! These settings (like fonts and orientation and duplexing, etc) will affect every job sent to the printer (a very bad thing).

Now some printing subsystems will override all settings by sending a long setup string to the printer and assuming nothing about the printer defaults. But most systems (including HP-UX) send nothing more than ESC E (printer reset) so you're seeing the printer's default settings. Now you can verify this by overriding the defaults with the -oportait option, but that is a kludge. Cold-Reset the printer back to factory defaults by turning off the printer, then hold down the Online key (the key varies with the printer model) and tunr the power on while holdiung the key down. Once you see a cold-reset message on the printer, you'll need to set the LAN card addresses and now it should print correctly.

As far as the special escape sequence, this 'may' work OK or be slightly off because of the small differences between the dozens and dozens of LaserJet models. This is especially true for multi-function (all-in-one) printers which are heavily designed for Windows printing subsystems. You'll need to decode all the escape sequences using a good PCL5 Technical Reference manual.


Bill Hassell, sysadmin
Clint Gibler
Frequent Advisor

Re: Printing Problem

Somebody had changed the default settings on the printer to landscape so I changed it back to portrait.
Clint Gibler
Frequent Advisor

Re: Printing Problem

na