1837239 Members
2213 Online
110115 Solutions
New Discussion

A printing issue

 

A printing issue

I have a shell script producing a nice report which I must print on a laser printer.

So "script.sh" outputs a file "report.txt"

How can I print a code so I can have my report on "letter US/portrait" and sometimes "Legal US/Landscape" when sent down to print
If it ain't rough it ain't me
6 REPLIES 6
Bill Hassell
Honored Contributor

Re: A printing issue

Well, there are hundreds of laser printers, each with a specific language. The vast majority of laser printers are based on PCL in which case, the model scripts supplied by HP already have the options encoded in the script. So to tell the printer to select A4, use the option:

lp -oA4 report.txt

Whether this option works depends on what script you picked for your printer when you set it up. None of the above will work if you are printing to a remote printer unless the remote host is HP-UX. In that case, you'll have to read your printer manual to determine the escape codes for A4 paper selection.


Bill Hassell, sysadmin
Steve Steel
Honored Contributor

Re: A printing issue

Hi


if this is a jetdirect network printer then each of the scripts has an own manpage showing the options available.

export MANPATH=/opt/hpnp/man:$MANPATH
man net_ljx000

as an example.



Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Printaporn_1
Esteemed Contributor

Re: A printing issue

Hi,

Use -olandscape
if you're not using remote printer , see support option for this printer in /etc/lp/interface/
enjoy any little thing in my life

Re: A printing issue

Actually, even if your answers are not what I expected to have, they helped me find a workaround to solve my problem, so if you guys repost, i can give extra points
If it ain't rough it ain't me
MANOJ SRIVASTAVA
Honored Contributor

Re: A printing issue

Hi

This comes from a old time expreince of using top of form and vertical tabs on the parallel port . If you just print a file having cntrl l it will skip a page on a Laser Printer .So to keep my self busy what I will do is to

1.check for the cntrl code to select the differnt types of paper.
2, create a spooler file which can change the setting throught the s/w to make the printer select different paper .

3. Print the differnt formats


All the best.


MAnojS rivastava

Re: A printing issue

Im doing something like that.
Since I have generic printers and laser printers, I format the files for everyone,
set parameters in the spooler files for the lasers, define the generics on the printers directly. It is not the most elegant but it works ^_^
If it ain't rough it ain't me