1837680 Members
4508 Online
110117 Solutions
New Discussion

Re: lp and ux2dos

 
SOLVED
Go to solution
ikbea
Frequent Advisor

lp and ux2dos

Hi all,

For HPUX 10.20 S800, there is no problem for user printing document (lp) to existing dot matrix printer. A new network laser printer is added and will be replaced the dox matrix printer. When use "lp", the carriage return of line feed problem occur. From the forum, the problem can be solved by "$ ux2dox | lp".

However, programs of all applications should be changed if use ux2dos.

Can I rename /usr/bin/lp to /usr/bin/lporg, then I write a new scipt /usr/bin/lp to call "$ux2dos | lporg" ?

As /usr/bin/lp is not text format and system level executable file, any impact if I rename /usr/bin/lp?

Thank you.

Thank you.


6 REPLIES 6
Peter Godron
Honored Contributor

Re: lp and ux2dos

Hi,
are you sure you have all the correct software for your printer installed.
We have used networked printers on HPUX 10 and 11, without encountering your problem.

You could do what you suggest, but this may be overwritten by a install and are you going to handle all the parameters for lp.

Check your /etc/lp/interface/.
How did you set up your network printer (JetAdmin ..) ?
V. Nyga
Honored Contributor

Re: lp and ux2dos

Hi,

I shouldn't change lp.
Simply change the model of your installed printer or add a new one.
Some configurations need carriage return, some not.
I don't know the pure commands.
You also can use SAM to change or add the printer.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
ikbea
Frequent Advisor

Re: lp and ux2dos

For adding the network laser printer (model HP Series 8000), in SAM --> printer and plotters --> add remote printer/plotter -->
checked "remote printer is on a BSD system"
remote cancal model: rcmodel
remote status model: rsmodel

When I use 'Add Network-based printer/plotter' --> 'Add printer/plotter connected to HP JetDirect': display 'HP JetDirect printer software is not installed on your system'

I don't know whether the rcmodel/rsmodel included HP8000 driver ?
Can I update the driver for HP8000 in HPUX ?
Moreover, can I edit /etc/lp/interface/ ?

Thank you
Bill Hassell
Honored Contributor

Re: lp and ux2dos

This is a very common problem with non-HP printers and LAN cards. The printer has been configured as a remote printer which means 'normal' lp printing scripts cannot be used. Instead, a special process called rlp is used along with a (very archaic) remote printing script called rmodel. As mentioned before, do NOT change the lp command. Instead, edit the printer's active script in the directory: /etc/lp/interface. The rmodel script is copied to this directory and renamed with your printer's name.

Now here's the tricky part: the rmodel script uses rlp as the communication between HP-UX and the remote print server (in your case, a non-HP printer LAN). The easiest solution would be to put ux2dos as a filter in front of rlp but rlp won't accept STDIN as a substitute for the file to be printed. A couple of ideas:

1. Use ux2dos to copy $1 (in the script) to a temporary file, then change rlp command to use the temp file. Be sure to use traps to remove the file is=f the script aborts, and make the tempfile name unique with the script's PID. Then remove the tempfile when rlp is finished. This will slow down printing, especially with big print files.

2. Create a FIFO device file and use ux2dos to write $1 to the FIFO, then tell rlp to read from the FIFO rather than $1. You'll need to pick a unique name for the FIFO and handle removal the same as above (trap, etc).

3. The best method is to use an HP JetDirect LAN card. If your laser printer has a USB or parallel port on it, get an HP external JetDirect adapter, and use that as your network interface. Then add the printer using addqueue or hppi.


Bill Hassell, sysadmin
ikbea
Frequent Advisor

Re: lp and ux2dos

If I want to call /etc/interface/, do I need to specify lp -o option ?

Thanks again
Bill Hassell
Honored Contributor
Solution

Re: lp and ux2dos

The interface directory is /etc/lp/interface. Each script in that directory is called by the spooling system (lp command sends a message to lpsched and lpsched runs the script in thye interface directory--simplified). So the script is called with the following parameters:

$1 = name of the printer_queue
$2 = requestID
$3 = userID
$4 = number of copies
$5 = all -o options
$6 = file to print
($7...) = more files to print if any

Now that's how the script is called. To put the ux2dos filter into place, you must modify the script itself. If you're not familiar with scripting, perhaps a consultant can help.

Another solution is to create a script that adds the ux2dos filter and passes the new image to lp. You'll need to handle the possible options as well as handle file(s) versus STDIN as the method users will use to do their printing.

Or change your printer to use an HP LAN card and use the HPPI software.


Bill Hassell, sysadmin