Operating System - HP-UX
1834139 Members
2616 Online
110064 Solutions
New Discussion

Re: interface scripts for remote printer

 
Burhan I. Koni
Advisor

interface scripts for remote printer

hi
I have configured a remote printer that is connected to the network through jetdirect adapter. this printer has a third party flash memory to print arabic reports. I faced a problem in the output that there is extra two pages of garbage, when I asked the vendor of the flash memory he told me that i need to use a standard UNIX printer definition called Line dump printer, other, or ASCII printer type. and disable local filtering.
how can I do that, known that the OS HP-UX 11i
the printer is HP laserjet 4050

Regards
Burhan
2 REPLIES 2
Rick Garland
Honored Contributor

Re: interface scripts for remote printer

If the printer was added via SAM to be a remote printer, you do not have choice on the model/driver.

If the printer was added via JetAdmin then you would have a choice. Typically most HP printers will communicate back to JetAdmin and say "this is the model/driver to use". Before you press the "0" key to complete the process, the JetAdmin will display the selections that have been made and give you the opportunity to change. Select the "model" and there should be a Dumb Model available.
Bill Hassell
Honored Contributor

Re: interface scripts for remote printer

As mentioned, if the printer was added with lpadmin or SAM as a "remote" printer, there is no printer script, so data is sent in "Line dump printer" mode, also known as raw. Nothing is appended in HP-UX. You can verify that it is a remote printer with:

lpstat -v

Now if it was added to HP-UX with hppi (or the obsolete/deprecated jetadmin software), then there is indeed a model script. But it is really easy to bypass everything. Just print with lp -oraw or lp -orelay and that will remove any formatting. If that works OK, then you're all set *unless* you have special applications that do not allow and lp options. These programs commonly assume BSD printing and do not provide options for lp.

The alternative for these canned programs is to create a new printer with a do-nothing script. HP has one called dummy although it does have some code for banner pages. So here's a truly dumb script:

#!/usr/bin/sh
# Truly dumb model script
# No options are used or recognized including copy count
# Does not support serial printers where the baud rate must be set

export PATH=/usr/bin
export PATH

# These are just for documentation - not used
JOB="$1"
NAME="$2"
DEV="$3"
TITLE="$4"
COPIES="$5"
OPTIONS="$6"
COPIES=$4
shift 5
FILES="$@"

# Print the spooled files
for LPFILE in $FILES
do
cat "$LPFILE" 2>&1
echo "\014\c" # this is a formfeed, optional for some printers
done

exit

---
Create another hppi copy of the same printer, then copy the above script on top of this new printer's script in /etc/lp/interface/model.orig


Bill Hassell, sysadmin