1823127 Members
3146 Online
109646 Solutions
New Discussion юеВ

Re: Network printing

 
Graham Van der vaart_1
Super Advisor

Network printing

Hi
At one of our client sites we have used remote printers extensively for the business systems.
In fact, we have not used network printers (on HP-UX) at all.
The business systems employ BRIO and SQR reports. These reports generated on HP-UX would be printed by users using the report viewers available to the above products. The remote printers are setup on Windows file and print servers.
Recently, a user requested that an SQR report print double sided without human intervention (ie not via the viewer). But, this requirement is for only a single report (generated daily by a batch process on HP-UX) to a single printer. All other reports to this printer must not print double sided.
What is the best and most convenient way to fulfill the users request?
Regards
Graham
5 REPLIES 5
Peter Nikitka
Honored Contributor

Re: Network printing

Hi Graham,

if you want to do this on the printer level, you would have to create a seperate local printer.
In the interface script of that printer you can prepend the postscript command or escape sequence for doubleside printing and then send the whole data to your original printer.

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"
Graham Van der vaart_1
Super Advisor

Re: Network printing

Hi Peter
Thanx for the response. Just a quick question. How do you relate the "local printer" to the "remote printer" so that you can send the whole data to the original printer (remote printer)?
Regards
Graham
Peter Nikitka
Honored Contributor

Re: Network printing

Hi,

- if the 'real' printer is fixed, hardcode it in the interface script.

- if you there a very few 'real printers', create a frontend printer for each of it with a name 'lrealprinter' and in the identical interface scripts use that construction (ksh/posix sh assumed):
..
realpr=${0##*/}
realpr=${realpr#l*}
...

- if this has to set dynamically, you have to supply the real printername as an option to the lp-command:
lp -o realpr=PRINTER ...
and in the interface script
add/create a loop for parameter 5 like this:

...
optionlist=$5
for o in $optionlist
do
case $o in
realpr=*)
realpr=${o#realpr=*} ;;
...
esac
done


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"
Bill Hassell
Honored Contributor

Re: Network printing

This is more complicated then it would first appear. If you have HP network printers (ie, the LAN card in the printer is an HP JetDirect card or external adapter) then you can create multiple printer queues (printer names for lp) where the default settings can be changed (ie, duplex=default). A truly local printer (with a serial or parallel cable from HP-UX to the printer can also be configured with multiple queues.

However, it sounds like you have remote printers, that is, printers that are connected to other computers like Windows and you are sending the jobs to the remote computer, not the printer. This is the worst situation because you have no control over the remote server. The usual -o options are ignored for remote printers.

The model script used for remote printers is found in /usr/lib/lp/model/rmodel and you'll see there are no options for duplex (or landscape, etc). You might create a second printer queue and then modify the new queue's printer script (found in /etc/lp/interface). You'll need to look at the man page for rlp to see how it is used. Note that rlp accepts only a filename as input so the file will have to be recreated with an inserted escape sequence (that matches that particular printer's requirements) to trigger duplex (double sided) printing.


Bill Hassell, sysadmin
Alzhy
Honored Contributor

Re: Network printing

This should be easy.

Regardless of whether your prints from UNIX is text, PCL or Postscript - find out the PCL ESC sequence to enable and disable duplex printing. Once you got the code right - create a wrapper lp script that will add and append the duplex enable and disable (respectively) codes as part of the print stream submitted to the remote printer queue.

I've done this a lot of times in the past. You can even embed in yur print stream things like - forms control, tray control, etc. All control codes should be in the printer manual.

Hope this helps.
Hakuna Matata.