Operating System - HP-UX
1821988 Members
3536 Online
109638 Solutions
New Discussion юеВ

how do I set "landscape" printout by default

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

how do I set "landscape" printout by default

I have some network printer queues, and they are created by hppi tool. Now I want to all outputs are printed as landscape format without using -o optioni, just use "lp -dprintername filename".

I have another system, and all printers configured on that system will produce landscape format.
thanks for your help.
none
20 REPLIES 20
Rick Garland
Honored Contributor

Re: how do I set "landscape" printout by default

The /etc/lp/interface/model.orig/ file. Depending on the printer and the model in use you may have to dig to find it.

Compare the other printer (doing landscape) with the new printer you are working on.
Hanry Zhou
Super Advisor

Re: how do I set "landscape" printout by default

But, I wanted to have all printer queues created being able to print out landscape as default.

Is there anything I can do during I use "hppi"?
none
Sanjay_6
Honored Contributor

Re: how do I set "landscape" printout by default

Hi Hanry,

hppi doesn't have an option to change the defaults.

Hope this helps.

Regds
Hanry Zhou
Super Advisor

Re: how do I set "landscape" printout by default

compare two printer file under ./model.orig, they are exactly same, but one can print landscape, another can't. So what you suggested doesn't seem to be the area I should be looking into.

none
Rick Garland
Honored Contributor

Re: how do I set "landscape" printout by default

I cannot see anything in hppi.

Another option is to write a wrapper script. When the lp command is invoked, direct it to executing your wrapper script which will have the -o landscape option.

Depending on how many printers you manage, this could be a time saver.

Hanry Zhou
Super Advisor

Re: how do I set "landscape" printout by default

I know the work around, but the question why printers on one server can print landscan which is not using any extra script, but the other can not.
none
Rick Garland
Honored Contributor

Re: how do I set "landscape" printout by default

Are the users printing from a command line or from an application? If from the app is it invoking a wrapper of some kind?

Other thing to look at is the printer itself. Depending on the printer you can set the firmware in the printer to print landscape all the time.

Hanry Zhou
Super Advisor

Re: how do I set "landscape" printout by default

from the unix command line, like I said before, they are just using "lp -dprintname filename", and the output will be landscape.

some printers are same model.
none
Rick Garland
Honored Contributor

Re: how do I set "landscape" printout by default

When you say printers on one server print landscape all the time, are these remote printers? To a Windows print server?

Hanry Zhou
Super Advisor

Re: how do I set "landscape" printout by default

they are all network printers.
none
Bill Hassell
Honored Contributor
Solution

Re: how do I set "landscape" printout by default

Since the printer scripts are the same, you can blame the users. The bigger HP printers have a front panel and some user decided to 'force' landscape into the default configuration for the printer. You can verify this by explicitly printing -oportrait and then -olandscape and then leave out both options. The printer's default will be with no options.

Setting a printer's defaults in the printer is not a good idea. It affects every print job regardless of where it came from. Now PCs almost never send plain ASCII files. Even old Notepad has been enhanced to add font selection, etc and usually overrides most of the default printer settings. Only a DOS command line can ensure pure ASCII printing from a PC. But for Unix systems, the default is to do nothing about overriding the printer's defaults. Another common user change is the font size, width and height and also the page layout in lines per page and lines per inch.

If these printers are shared with other Unix systems, slap the hands of users that change the printer's defaults. Always change the defaults in the printer scripts.


Bill Hassell, sysadmin
Rodney Hills
Honored Contributor

Re: how do I set "landscape" printout by default

Landscape can be set as a default on the printer (as configured through the front panel) or an escape sequence sent by print driver script or application.

If you are looking to always do landscape, then you could alias the lp command. example-

alias lp=lp -olandscape

Then anyone that does a "lp printfile" will automatically have the landscape option set.

The other alternative is to make it the default under the print driver script under /usr/spool/lp.

HTH

-- Rod Hills
There be dragons...
Rick Garland
Honored Contributor

Re: how do I set "landscape" printout by default

If you print from server1 to printer1 it comes landscape.

If you print from server2 to printer1 is it landscape? or portrait?

This would be printing the same job as well.

Looking to narrow down the possibilities - is it the server(s) or the printer(s)?

Is it possible that printer escape codes are embedded in thre document that is being printed?

Hanry Zhou
Super Advisor

Re: how do I set "landscape" printout by default

Bill,

If I use the command "lp -dPrint -oportrait", and then it produces a normal portrait format, that indicates the user has default configuration settings on the printer itself?
none
Bill Hassell
Honored Contributor

Re: how do I set "landscape" printout by default

That's correct. -oportrait or -olandscape overrides the default setting in the printer.


Bill Hassell, sysadmin
Hanry Zhou
Super Advisor

Re: how do I set "landscape" printout by default

Rodney,

I went to the directory you suggested /usr/spool/lp, but which file(driver) I should be looking into to set the default as you indicated? there are a lot of files underneath.
none
Rick Garland
Honored Contributor

Re: how do I set "landscape" printout by default

/usr/spool/lp/model contains the driver files for the various printers you may use. This s where the hppi grabs it driver file when adding a printer.

Example, the laserjet driver is by default portrait. There is a line in the file; orientation="def"

There is a case statement for orientation portrait|def. Change so the the def is with the landscape.

I have this beginning at line 588 of the laserjet file
Hanry Zhou
Super Advisor

Re: how do I set "landscape" printout by default

Rick,

thanks for the message.

After I finish creating a printer queue, how can I find out what printer model I used during the process of creating the queue?
Did I choose laserjet5i or deskjet500?
none
Rick Garland
Honored Contributor

Re: how do I set "landscape" printout by default

Look into the driver file setup for the printer. This will reside in /etc/lp/interface/model.orig. There will be a file with the printer name. vi the file and you will see the driver name in the top of the file (2nd or 3rd line down)
Bill Hassell
Honored Contributor

Re: how do I set "landscape" printout by default

These scripts are not drivers in the classic sense. They are ASCII formatters with little functional differences between the different printer models. For hppi, the template scripts are located in /opt/hpnpl/sh and one is copied and renamed for each printer you create. There's no log kept of which file is used, you can either use diff between the hppi template directory and /etc/lp/interface/model.orig files. Or just delete the printer in hppi and add it back again.


Bill Hassell, sysadmin