Operating System - HP-UX
1752781 Members
6560 Online
108789 Solutions
New Discussion юеВ

Re: HP-UX 11.11 non-HP remote printer stair stepping

 
Rhonda Mokri
Advisor

HP-UX 11.11 non-HP remote printer stair stepping

We are trying to configure a Lanier 5705 network printer to work with the HP-UX 11i environment. The printer queue was created as a remote printer which allows us to send a print job to the printer but find that it is stair stepping the output. I've spent some time reviewing previous postings for information on how to correct this problem and have tried some of the solutions but have not hit on the right combination yet. The ascii text file that I am testing with was sent to the printer with the ux2dos statement but that didn't do anything - still seeing the text stair stepped on the printout. Also discovered that the -o parameters aren't working and saw a reference in the posts that this is an expected outcome if using the remote printer option in HP-UX. Is there a way around this problem for the Lanier printer?
13 REPLIES 13
A. Clay Stephenson
Acclaimed Contributor

Re: HP-UX 11.11 non-HP remote printer stair stepping

You could create a very simple filter like this to feed to each lp command.

awk '{printf("%s\r\n",$0)}' < infile | lp -dyourprinter
If it ain't broke, I can fix that.
Rhonda Mokri
Advisor

Re: HP-UX 11.11 non-HP remote printer stair stepping

The filter did stop the stair stepping problem printing an ascii file to the lanier printer. As this is the first time that I have ever needed anything like this to print to a network printer (I'm new to HP-UX) how would you recommend that I automate using this filter? Create an alias for the command or put it in a script?
A. Clay Stephenson
Acclaimed Contributor

Re: HP-UX 11.11 non-HP remote printer stair stepping

We should be able to put this in the interface file, I'll assume your printer is called 'yourprinter'.

cd /var/spool/lp/interface
cp yourprinter yourprinter.safe

vi yourprinter and look for the line"printer=`basename $0`". Just below it add this code.

TDIR=${TMPDIR:-/var/tmp}
T1=${TDIR}/Tp${$}_1.txt

trap 'eval rm -f ${T1}' 0 1 2 15

Now look for the line containing "shift; shift; shift; shift; shift". Just below it add this code:

DIRNAME="/var/spool/lp/request/${printer}"
REQNO=$(echo "${requestid}" | awk -F '-' '{print $NF}')
FNAME=$(ls ${DIRNAME}/d*${REQNO}[A-Za-z]*)
if [[ -f "${FNAME}" ]]
then
awk '{printf("%s\r\n",$0)}' < "${FNAME}" > ${T1}
ASTAT=${?}
if [[ ${ASTAT} -eq 0 ]]
then
mv ${T1} "${FNAME}"
ASTAT=${?}
if [[ ${ASTAT} -ne 0 ]]
then
echo "${printer} mv failed; status ${ASTAT}" >&2
fi
chmod 440 "${FNAME}" # optional
else
echo "${printer} awk failed; status ${ASTAT}" >&2
fi
fi


# The existing rlp command should be here

--------------------------------
If I haven't made any typing booboo's that should fix you.
If it ain't broke, I can fix that.
Rhonda Mokri
Advisor

Re: HP-UX 11.11 non-HP remote printer stair stepping

Clay: I tried making the change to the /var/spool/lp/interface/ file but this did not fix the problem. The output is still stair stepping. Have double checked my typing and tried the cut and paste method of dropping in your stanza in the printer interface file but neither is correcting the problem.

Should I be looking for a vendor supplied interface file for the Lanier printers?
Rhonda Mokri
Advisor

Re: HP-UX 11.11 non-HP remote printer stair stepping

In further testing print jobs to this queue from application created print jobs, they are successfully printing to this remote printer without the problem of stair stepping text. The main issue now that I need to resolve is fixing the problem with the page orientation and compression not working properly.
A. Clay Stephenson
Acclaimed Contributor

Re: HP-UX 11.11 non-HP remote printer stair stepping

The change I suggested to the interface file should be extremely close. I would add some probes that echo to a file. First disable this printer (on your local host) and then submit a printjob. You should the the d* file in the request directory. Next enable the printer and try again. I would change the mv command to a copy and disable the trap so that the temp file is left in place. I have done something very similar to tack on a FF for a Lanier so this should be very close. Use a text file as input as opposed to input from a pipe.
ie. use lp -dyourprinter your_file
rather than:
cat your_file | lp -dyourprinter.

You should be able to get this going with just a little debugging.

Probably the easiest fix is to see if there is a configuration on this printer to convert LF to CRLF. That is an extremely common printer feature.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: HP-UX 11.11 non-HP remote printer stair stepping

Now we have entered a realm that is beyond the scope of this course and probably not directly doable. You have know found the distinction between what in HP-UX speak is a Network printer and a Remote printer. By far, the easiest method (assuming this printer will do PCL emulation or Postscript) is to make it a Network printer by attaching an external JetDirect via the parallel port. You can leave the printer configured as LPD device and other boxes will use that hostname and you will use the hostname associated with the JetDirect. You might look on the Lanier site to see if they have printing software for HP-UX but my standard for these things is an external JetDirect.
If it ain't broke, I can fix that.
Rhonda Mokri
Advisor

Re: HP-UX 11.11 non-HP remote printer stair stepping

Clay: Would you clarify what you meant by your earlier posting "You should the the d* file in the request directory". Not clear what you were recommending. thx

A. Clay Stephenson
Acclaimed Contributor

Re: HP-UX 11.11 non-HP remote printer stair stepping

FNAME=$(ls ${DIRNAME}/d*${REQNO}[A-Za-z]*)

This is how I assume that the actual pathname to be transferred to the remote host is constructed. If this is wrong then awk will never be invoked.

In any event this will not fix your larger formatting problems. Had you stated what you were trying to do other than simply correcting the CRLF's then we would not have gone down this road.
If it ain't broke, I can fix that.