Re: HP-UX 11.11 non-HP remote printer stair stepping (711 Views)
Reply
Advisor
Rhonda Mokri
Posts: 26
Registered: ‎11-10-2005
Message 1 of 14 (711 Views)

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?
Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 2 of 14 (711 Views)

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.
Advisor
Rhonda Mokri
Posts: 26
Registered: ‎11-10-2005
Message 3 of 14 (711 Views)

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?
Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 4 of 14 (711 Views)

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.
Advisor
Rhonda Mokri
Posts: 26
Registered: ‎11-10-2005
Message 5 of 14 (711 Views)

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?
Advisor
Rhonda Mokri
Posts: 26
Registered: ‎11-10-2005
Message 6 of 14 (711 Views)

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.
Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 7 of 14 (711 Views)

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.
Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 8 of 14 (711 Views)

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.
Advisor
Rhonda Mokri
Posts: 26
Registered: ‎11-10-2005
Message 9 of 14 (711 Views)

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

Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 10 of 14 (711 Views)

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.
Advisor
Rhonda Mokri
Posts: 26
Registered: ‎11-10-2005
Message 11 of 14 (710 Views)

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

What I was trying to say is that you didn't include the action you were trying to convey - instead the sentence has two "the's" where I believe you meant to provide an instruction.

We have the need to print both ascii text AND application text which is formatted so your help has been very useful in helping me understand how to go about fixing both problems. Right now we are trying to dredge up a hp jetdirect card to solve the application printing problem for the hp-ux users as they really would like to use the network printers that are mostly laniers.
Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 12 of 14 (710 Views)

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

You probably want an external JetDirect (e.g. JetDirect 300x) rather than a card.
If it ain't broke, I can fix that.
Advisor
Rhonda Mokri
Posts: 26
Registered: ‎11-10-2005
Message 13 of 14 (710 Views)

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

Thanks - we will change our search instead for an external jetdirect as I am trying to fix this as simply as possible.

As I am trying to edit the interface file again and follow your troubleshooting tips, would you please clarify your reply created at 19:48:54 "You should the the d* file in the request directory". What should I do to the d* file? delete it?
Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 14 of 14 (710 Views)

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

You should SEE the d* file in the request directory. Do this to verify that 1) the file is being created and 2) that the filename conforms to this:

DIRNAME="/var/spool/lp/request/${printer}"
REQNO=$(echo "${requestid}" | awk -F '-' '{print $NF}')
FNAME=$(ls ${DIRNAME}/d*${REQNO}[A-Za-z]*)

If not then alter the code until it matches the pattern that your lp subsystem generates.

Unless you first disable "yourprinter" then this file will be transferred to the remote host so quickly that you will never see it.
You can then enable "yourprinter" and the normal transfer will take place.

To get rid of any of these files, you can simply cancel the printjob.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.