Operating System - HP-UX
1855136 Members
3125 Online
104109 Solutions
New Discussion

printing in landscape to HP printer

 
SOLVED
Go to solution
Derek Brown
Frequent Advisor

printing in landscape to HP printer

Hi,

I've moved to a new office. In my old office I could print from unix to a networked printer simply by setting the printer to landscape on the printer itself. In this new office I've got a networked HP LasetJet 4250dtn to print to which has no landscape setting on the printer itself so I'm assuming I can manage it by configuring at Unix level. I'm actaully running a Sun Ultra 5 workstation but I'm thinking the commands will be the same as HP anyway.

This is my problem. I've created a print landscape using a PCL filter and it hasnt worked. Can anyone help please ? This is what I've done so far :

tkdu30 /usr/local/bin> cat la*
#!/bin/ksh
#
# /opt/local/bin/landscape.sh
# Example of a script to print landscape using PCL
#

# Put into landscape
# Control + V, Esc, ampersand, lower case l (ell), 1 (one), upper case O (oh)

echo "^[&l1O"
cat -
#echo "^[&l0O"

# Put back to portrait - not always required
# Control + V, Esc, ampersand, lower case l (ell), zero (0), upper case O (oh)


................................................
tkdu30 /etc/lp/fd> cat landscape.fd
Input types: any
Output types: landscape
Printer types: any
Printers: any
Filter type: slow
Command: /opt/local/bin/landscape.sh
tkdu30 /etc/lp/fd> lpfilter -f landscape -F /etc/lp/fd/landscape.fd
tkdu30 /etc/lp/fd> lpadmin -p landy -o protocol=bsd,dest=hostname -v /dev/nul>
tkdu30 /etc/lp/fd> enable landy ; accept landy
tkdu30 /etc/lp/fd>
tkdu30 /etc/lp/fd> cat /etc/printers.conf
#
# If you hand edit this file, comments and structure may change.
# The preferred method of modifying this file is through the use of
# lpset(1M)
#
UKNEWPRT021:\
:bsdaddr=UKNEWPRT021,TEXT:\
:description=behind Richard:

_default:\
:use=UKNEWPRT021:

landy:\
:bsdaddr=UKNEWPRT021,landy,TEXT:
tkdu30 /etc/lp/fd>
tkdu30 /etc/lp/fd>
tkdu30 /etc/lp/fd> cat /etc/hosts
127.0.0.1 localhost
10.120.9.24 tkdu30 loghost
10.120.7.42 UKNEWPRT021 # Local Printer

******************************************************************************
* Server Consolidation
******************************************************************************
HDC
***
10.141.3.210 ngttrmhdc002 cy-hdc # Cyclade
10.141.3.202 ngsvshdc011 hdc11 # 240 BOKS
10.141.3.203 ngtsvshdc012 hdc12 # 240 BOKS Spare
10.141.3.204 ngsvshdc013 hdc13 # 440 BOKS Spare
10.141.3.205 ngtsvshdc014 hdc14 # 440 RF Unix 1
10.141.3.206 ngsvshdc015 hdc15 # 490 Unix 2
10.141.3.207 ngsvshdc016 hdc16 # 490 RF Spare
10.141.3.86 ngsvshdc019 hdc19 # 240 RF
LDH
***

10.140.3.210 ngttrmldh002 cy-ldh # Cyclade
10.140.3.202 ngtsvsldh012 ldh12 # 240 RF Siteminder
10.140.3.203 ngtsvsldh013 ldh13 # 240 RF Siteminder
10.140.3.204 ngtsvsldh014 ldh14 # 440 BOKS Spare
10.140.3.205 ngtsvsldh015 ldh15 # 440 RF Unix 1
10.140.3.206 ldh016 ldh16 # 490 RF Unix 1
10.140.3.207 ngsvsldh017 ldh17 # 490 RF Spare

******************************************************************************
PAI
******************************************************************************
10.141.5.200 senegal
10.141.5.120 senegali5 # Console
10.141.70.120 senegali4 # Backup LAN

******************************************************************************
MOP
******************************************************************************
10.143.2.9 ngtsrvwok026 wok026
10.142.1.17 ngtsrvwrk031 wok031
tkdu30 /etc/lp/fd>
tkdu30 /etc/lp/fd>
tkdu30 /etc/lp/fd> lp -d landy /etc/hosts
request id is landy-362 (1 file)
tkdu30 /etc/lp/fd>

...............................................


A print does appear but it comes out in portrait.
I feel as if I've missed something obvious. If anyone can help I'd be most appreciative.
Many thanks

9 REPLIES 9
V. Nyga
Honored Contributor

Re: printing in landscape to HP printer

Hi,

as you're using th lp command,
why don't you print 'lp -olandscape'?

Volkmar
*** Say 'Thanks' with Kudos ***
Peter Godron
Honored Contributor

Re: printing in landscape to HP printer

Derek,
have you tried:
lp -d landy -o landscape /etc/hosts
Pete Randall
Outstanding Contributor

Re: printing in landscape to HP printer

Derek,

Have you tried the simple approach:

lp -ohpgl2


Pete

Pete
Peter Nikitka
Honored Contributor
Solution

Re: printing in landscape to HP printer

Hi,

since the LJ4250dtn is a Postscript capable printer, you best install a2ps (it may be already there) from sunfreeware.com.

Formatting is done as a seperate process and there is no need to diddle with printer interfaces.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Derek Brown
Frequent Advisor

Re: printing in landscape to HP printer

Thanks guys but none of the options you gave me worked. A portrait print came out along with the error message "landy not configured to handle all lp options : ignoring : -o landscape"
Derek Brown
Frequent Advisor

Re: printing in landscape to HP printer

Peter ....

Can you be a bit more elaborate please. I've been onto sunfreeware.com and can't find anything called a "2ps". What is this and how do you use it please ? Sorry for being a bit slow !
Pete Randall
Outstanding Contributor

Re: printing in landscape to HP printer

Derek,

Search for "a2ps" not a "2ps".


Pete

Pete
Peter Nikitka
Honored Contributor

Re: printing in landscape to HP printer

Hi,

since ITRC was inoperative (here?), I am a bit late, but:

I wrote 'a2ps' and here is a link to the Solaris 10 SPARC version:
ftp://ftp.sunfreeware.com/pub/freeware/sparc/10/a2ps-4.13b-sol10-sparc-local.gz

Of course you will select the appropriate version of your OS.

Use then a plain printer entry of /etc/printers.conf
like my HP network printer is:
n666:\
:bsdaddr=forth,n666,Solaris:

mfG Peter

PS: HP network printers are best made available via the 'HP JetDirect Printer Installer'; check if available via
pkginfo -l HPNPL
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Derek Brown
Frequent Advisor

Re: printing in landscape to HP printer

Excellent. Thanks. That's cracked it.

A2PS from sunfreeware.com is just what I needed. I've downloaded it and installed it. All OK now.