Operating System - HP-UX
1822525 Members
2591 Online
109642 Solutions
New Discussion юеВ

Re: Print using lp cmd to set left margin in hpux

 
Husaini_1
Advisor

Print using lp cmd to set left margin in hpux

I faced a problem with modifying the margin of the printing in hpux. We are planning to print the customer statement on a normal HP LaserJet printer.We need to adjust the margin on the left so it will printed in the middle. Could you guys out there help me on how to print it by cmd line?

I use cmd below:
# lp -d printer4 -olm30 /tmp/test.page
7 REPLIES 7
Bill Hassell
Honored Contributor

Re: Print using lp cmd to set left margin in hpux

The -o options work fine as long as the printer is connected directly using an HP JetDirect LAN card. If the printer is a remote printer, that is, connected to some other system like Windows or Linux, or connected using a non-HP LAN adapter, then -o options will not work. Remote printers do not understand the -o options.


Bill Hassell, sysadmin
James R. Ferguson
Acclaimed Contributor

Re: Print using lp cmd to set left margin in hpux

Hi:

If, as Bill noted, your setup involves remote printers where the '-o' options of 'lp' won't help, you might find 'pr' useful:

# pr -o 16 myfile | lp -d myprinter

The '-o 16' will indent 16 spaces from the left. See the 'pr' manpages for more options.

Regards!

...JRF...

Husaini_1
Advisor

Re: Print using lp cmd to set left margin in hpux

Hi Bill/James,

Thx for the info.

There is an application running in my box and i want to print it using application menu. Yes its work using cmd line (pr -o 20 /tmp/test.page | lp -d printer5) but can i set this as permanent. Is there any conf file to set this up?
Dennis Handly
Acclaimed Contributor

Re: Print using lp cmd to set left margin in hpux

>but can I set this as permanent. Is there any conf file to set this up?

It would have to be a conf file for your application to change the lp command to that pr/lp pipeline.
Husaini_1
Advisor

Re: Print using lp cmd to set left margin in hpux

if my application is refer to printer queue name by default, is there any conf file can be change. How about /etc/lp/interface/model.orig ?
Dennis Handly
Acclaimed Contributor

Re: Print using lp cmd to set left margin in hpux

>How about /etc/lp/interface/model.orig?

If you're a code monkey, you can simply change the model script for the printer in question. :-)
Bill Hassell
Honored Contributor

Re: Print using lp cmd to set left margin in hpux

> if my application is refer to printer queue name by default, is there any conf file can be change. How about /etc/lp/interface/model.orig ?

No, the problem is the very big differences between HP printers on the network and printers that are being shared (remote printers). The model.orig directory is only used for HP printers with HP LAN cards when setup using hppi or SAM as network printers. Since the -olm30 option doesn't do anything, it would appear that the printer is a shared or remote printer. There is no config file to change the printer script. You might play with the remote printer script in /etc/lp/interface.


Bill Hassell, sysadmin