Operating System - HP-UX
1836770 Members
2218 Online
110109 Solutions
New Discussion

hppi printing multiple pages

 
SOLVED
Go to solution
Paul Sperry
Honored Contributor

hppi printing multiple pages

Hi,

I have set up several printers using hppi.
Mostly HP laserjet printers. On the printer I set the option to print 3 copies. But when I do a lp -dprinter file only one copy comes out.
When I print something from windows notepad 3 copies come out. I can not use the -n option of lp because I need this to work from within an application. Makes me think there is a setting somewhere in the printer queues that is limiting it to one copy but I cant find it.

OS hp-ux 11.11 fairly up to date with patches

Thanks in Advance
5 REPLIES 5
Sanjay_6
Honored Contributor
Solution

Re: hppi printing multiple pages

Hi Paul,

You can check on the copy=$4 variable in the printer interface script. This should be under /etc/lp/interface directory.

Hope this helps.

Regds
Bill Hassell
Honored Contributor

Re: hppi printing multiple pages

The days of one printer on one computer have long disappeared. What this means is that the settings of the printer must never be changed, especially for typical Unix printing which is plain ASCII. Windows has a complete printing subsystem where applications know nothing about the target printer. Instead, the app makes calls to the printer subsystem using a meta-language rather than specific printer codes. Then it is up to the driver to translate all of this into printer-specific codes.

So in Windows, the printer is automatically sent a series of setup codes, and with WinXP or Win2K, Notepad is no longer a simple text editor. Notepad has the ability to change fonts.

But in Unix, there is no driver, just a simple printer script that understands some -o options. Since your app does not use the lp command, there is no way to access these options.

Now all of this is to explain that changing the default settings in shared printers is not a good idea at all. The -n option in HP-UX is not a printer feature, it is a loop in the printer script that sends the job 3 times to the printer.

So to keep everything sane, change the printer(s) back to all defaults (1 copy), then create a new printer queue using the addqueue command:

addqueue -h 12.34.56.78 -q hplj3

Since you are using the same IP address as the original printer, you can now modify the printer script to default the -n option to 3. Now printing to the standard printer gives 1 copy, printing to the xxxx3 printer produces 3 copies. Just modify the xxxx3 printer script located in /etc/lp/interface/model.orig to make this queue always print 3 copies (and any other custom features you might want). Just tell your app to use a different printer name.


Bill Hassell, sysadmin
Paul Sperry
Honored Contributor

Re: hppi printing multiple pages

Thanks Guys,

Both of you ideas worked.
although editing the file in /etc/lp/interface was a whole lot eaiser than the one in /etc/lp/interface/model.orig
I ended up using a combination of you ideas.
adding a second print queue hplj_3 and then editing the file in /etc/lp/interface changing copy=$4 to copy=3 now I just have to sell the idea to the application people.
Hopefully they wont say, but what if I want 4 copys or 5 copys etc...

Thanks Again
Bill Hassell
Honored Contributor

Re: hppi printing multiple pages

The model.orig is the pritner script that performs the actual formatting changes, while the interface script is just the connection between the printer (using hpnpf) and the printer script in model.orig. The answer as far as different copy counts go, is to create multiple queues as mentioned above. Use addqueue to create as many queuenames as you'd like to have. The JetDirect interface only accepts one connection at a time, so even if the computer is printing to 3 different queues, all with the same IP address, two of the jobs will be paused waiting for the printer to come free.

Just edit the interface scripts for your copy counts as you've done already. Now, the end user can change the copy count for the application by changing the name of the printer.


Bill Hassell, sysadmin
Sanjay_6
Honored Contributor

Re: hppi printing multiple pages

Hi Paul,

You can use a different queue for the same printer and let people choose the number of copies while printing to that queue (same printer).

Once you change the "copy=$4" parameter to "copy=3", you are forcing the script to print 3 copies instead of supplying the $4 parameter as an option to "-n" option with the lp command. If you use the -n option with the lp command for this printer queue, you may get an error message.

It is difficult to say whether it would still print 3 copies or the lp will just send an error and ignore the print command.

Hope this helps.

Regds