Operating System - HP-UX
1847232 Members
2244 Online
110263 Solutions
New Discussion

Making a Printer in HP-UX 11 print landscape

 
SOLVED
Go to solution
TCEQ UNIX
Advisor

Making a Printer in HP-UX 11 print landscape

I want the printer to print landscape by default. What would I can to cause this to happen?

He who does not slow down at the sight of a police car is usually parked.
10 REPLIES 10
Sanjay_6
Honored Contributor

Re: Making a Printer in HP-UX 11 print landscape

Hi,

If this is a jetdirect / network printer, try using the -o landscape option with the lp command.

Hope this helps.

Regds
Helen French
Honored Contributor

Re: Making a Printer in HP-UX 11 print landscape

Hi,

There is an option '-o landscape' which can be used with lp command. Check the file under /etc/lp/interface for available options.

HTH,
Shiju
Life is a promise, fulfill it!
MANOJ SRIVASTAVA
Honored Contributor

Re: Making a Printer in HP-UX 11 print landscape

Hi TNRCC

use the -o landscape option for landsacpe printing .

"

-ooption Specify a printer-dependent option. You can specify
several printer options by repeating the -o option.
For information about the options that are available
for a printer supported on your system, see the
interface script for the printer name in the
/etc/lp/interface directory."

you may also like to look at :

http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x0eefc6af36b7d5118ff10090279cd0f9,00.html


Manoj Srivastava
Jeff Schussele
Honored Contributor
Solution

Re: Making a Printer in HP-UX 11 print landscape

If this is a local printer then you can edit the interface file in
/etc/lp/interface/ptr_name
to force the -o landscape option on every job.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
TCEQ UNIX
Advisor

Re: Making a Printer in HP-UX 11 print landscape

"edit the interface file in
/etc/lp/interface/ptr_name
to force the -o landscape option on every job."

Jeff,
Your on the right track with this. However, it is not clear how one would do this. Do you (or anyone) know where I can find some documentation on how to do this?

Thanks,
Russell
He who does not slow down at the sight of a police car is usually parked.
Jeff Schussele
Honored Contributor

Re: Making a Printer in HP-UX 11 print landscape

Hi (again)

Let's say the interface is based on the std laserjet I/F.
There should be a section as follows:

case "$orientation" in
portrait | def)
orientation="portrait"
case "$dividing" in
-h);;
-q) fontdl /usr/lib/lp/fonts/lp4p;;
esac;;
landscape)
case "$dividing" in
-h) fontdl /usr/lib/lp/fonts/lp2l;;
-q) fontdl -l /usr/lib/lp/fonts/lp4l;;
esac;;
esac

Note that the portrait has the | def.
Switch the landscape to have the | def entry & you may test with a standard lp command w/o the -o parm.
If it's not the std laserjet I/F model you may have to poke around in the script. Just remember to cp a safe copy prior to editting.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Making a Printer in HP-UX 11 print landscape

Oh & you may also have to edit this section

case "$orientation" in
def);;
portrait) echo "\033&l0O\c";;
landscape) echo "\033&l1O\c"
length="-l45";;

To include the landscape strings after the def)
statement. I haven't had a chance to test but I think those are the only areas that would need mods.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
TCEQ UNIX
Advisor

Re: Making a Printer in HP-UX 11 print landscape

Jeff,
I did not find the code in /etc/lp/interface. But rather in /opt/hpnpl/sh/net_lj5x .
Since /opt is for 3rd party software and this is a network printer. I did not feel comfortable changing this code.
Under /etc/lp/interface/que_name it appears to call so much stuff that it would be very very easy to mess up a lot of stuff very quickly.
This is a great attempt but appears to come up a little short.
Any suggestions on where I am going wrong here.

Thanks,
Russell
He who does not slow down at the sight of a police car is usually parked.
Jeff Schussele
Honored Contributor

Re: Making a Printer in HP-UX 11 print landscape

Hi,

I can understand that. And you're not going wrong - it's just that the default is portrait until it sees the -o landscape on the command line. You *have* to edit the interface script to make it default to landscape & then you could include the -o portrait to go with that orientation when you so desire.
What you can do is make a safe copy of the file in /etc/lp/interface/queue_name
cp filename filename.safe
Then if you make a mistake editing you can simply remove the edited file & rename the safe one back.
Also having the "safe" copy easily allows you to go back & forth between portrait & landscape defaults simply by renaming the files.

I would disable the queue before editing if possible.

I found the "defaults" section & it may be the easiest way to change - it looks as follows
/Quote

# Initialize option variables to default values
length="def"
pitch="def"
spitch="def"
hsi="def"
spacing="def"
sspacing="def"
lpi="def"
vsi="def"
charset="def"
scharset="def"
height="def"
sheight="def"
style="def"
sstyle="def"
typeface="def"
stypeface="def"
weight="def"
sweight="def"
pagelen="def"
tpagelen="def"
scharset="def"
height="def"
sheight="def"
style="def"
sstyle="def"
typeface="def"
stypeface="def"
weight="def"
sweight="def"
pagelen="def"
tpagelen="def"
lmargin="def"
rmargin="def"
outputmode="cooked"
banner="yes"
orientation="def"
pagemode="def"
outb="def"
outbstring="OPTIONALOUTBIN"
mtype="def"
bannerpagemode="def"
duplex="def"
nroff=""
italics=""
outputmode="cooked"
banner="yes"
orientation="def"
pagemode="def"
outb="def"
outbstring="OPTIONALOUTBIN"
mtype="def"
bannerpagemode="def"
duplex="def"
nroff=""
italics=""
modeset="false"
dividing=""
ascii=""
bad_options=""
page_start=""
page_end=""
if [ "$default_mode" = "PostScript" ]
then
format="PS"
outputmode="raw"
else
format="PCL"
fi
paper="def"
resolution=""
printoptions=""
file_type=""
# Variables for Color Options
textcolor="def"
monochrome="def"
glossfinish="def"
printer_collate=""
staple_job=""
des_cs="def"

/EndQuote

Note that orientation is in here & set to "def" - you could try just changing it & only it to "landscape" & do a quick test.
Then if no -o portrait comes in on the command line it *should* default to landscape.
Just remember to make a safe copy & enable the printer after the change.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Bill Hassell
Honored Contributor

Re: Making a Printer in HP-UX 11 print landscape

Just a note about /opt: it is the optional software directory, not just 3rd party. /usr (according to SysV standards) is for system administration while /opt is for application programs. /opt/hpnp is the HP JetDirect software (application).


Bill Hassell, sysadmin