Link to home
Start Free TrialLog in
Avatar of Gtrist
Gtrist

asked on

Staircase Printing

I have a SCO OpenServer 5.0.5 server connected as a member server in a Windows NT4 domain. When I print from the Unix server to a printer on the NT network, I get a staircase output. I can eliminate the staircase output by forcing an add CR to LF at the HP laserjet control panel. However, I also deal with printers that don't have that option and I would like a fix that will work for any/all printers. I have printers that only exist on the Unix server, and I don't have the problem on those printers... only the NT laser printer.
Avatar of festive
festive

you can manually alter/edit the printer interface file for the printer in question on the sco system, adding a sed, tr command (or alike) to translate cr to cr/lf.

hope this helps.
Avatar of Gtrist

ASKER

I need a little more information than that. The printer in my network is a hp4000tn, and I have tried to edit the file
/usr/spool/lp/admins/lp/interfaces/hp4000tn
to add a -N to the line
"if $REALMODEL "$@" | $HPNPF -x $PERIPH 2> $LOG > /dev/null
as indicated in an article at aplawrence.com, but that didn't help. So far the only thing I have been able to do it the add CR to LF option on the printer itself. But, as I said, I need something that will work for all printer models.
The cleanest thing for HP printers is to connect the hp4000tn directly to the network and use HP's jetdirect software.
Software is avalable free for all versions of windows and included with SCO.
Other options are using Samba on the SCO box to print to NT/Windows shared printers or installing print filters if using lpd printing.

If you are already using jetdirect (as your second post implies) do NOT use the -oraw option on lp.
Avatar of Gtrist

ASKER

Adjusted points from 100 to 200
Avatar of Gtrist

ASKER

I have one printer set up on the Unix network that is using the HP software for configuration, and it is working just fine. It's the HP laserjet on the NT network that I need to get working reliably.
I am using LPD for the NT printer, and it is using the same interface file as the printer on the Unix server. That printer works great. I am open to a filter, but I am not sure how to create one that will do the job.
One last note, the application we use doesn't give you any option to redirect the print. You tell it you want to print to a specified printer and thats the last control you have.
Apologies if this is a double post - EE is a bit weird today :)

As festive said, you can modify the file "on the fly" to change LF to CR/LF

awk '{print $0,"\r"}' < inputfile > newfile will add the CR; The awk
construct can be used in pipe, rather than with i/o redirection, e.g.
echo ${file} | awk '{print $0,"\r"}' | ${printer}

The problem is how to insert this in a printer interface; This is highly
OS and printer dependent :(

In the line you showed from the hp4000tn interface script, the filename(s)
are passed to the REALMODEL  (which will be a standard script for most HP
LJ models), with all parameters "$@";

We need to extract the filenames & use the names to find & convert the
files themselves;

[You'll need to test this, by echoing $@, but assuming $@ expands to
jobno user title no_copies options file1 file2...]

 .
 .
 allparameters="$@"
 shift; shift; shift; shift; shift
 filenames="$*"

 for f in $filenames
 do
  awk '{print $0,"\r"}' < $f > /tmp/file_with_cr
  mv /tmp/file_with_cr $f
  # It would be better to test that the files aren't PostScript
  # before converting them!
 done
 .
 .
 $REALMODEL $allparameters | $HPNPF -x $PERIPH 2> $LOG > /dev/null
 .

If "$@" is used anywhere else in that script, it will need to be changed
to $allparameters.


You'll need a similar technique for other printer types - Unless kinsey has a better way, with filters :)



Avatar of Gtrist

ASKER

Can you explain more about your script. I don't have any scripting experience so I'm not sure about what you are suggesting.
ASKER CERTIFIED SOLUTION
Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can also use the ux2dos command.  It does essentially the same as the awk command does, but requires less typing.
Avatar of Gtrist

ASKER

I'm sorry that I haven't been keeping up with this question. I have been on the road for a couple of weeks, and I probably won't have time to work with this for a couple more weeks.
Hi Gtrist - I'm not being pushy, just keeping the question alive so it doesn't get autodeleted :)

Have you had a chance to look at changing the model.orig file according to the tip at aplawrence yet? IMO that would be the most elegant solution.
Avatar of Gtrist

ASKER

I have decided to accept your answer to clear this question. I haven't actually had much time to deal with this issue so I haven't thoroughly tested your answer. At the moment, this issue has become a low priority. If it becomes a high priority again, I may post another question on this topic.
Thanks one and all for your comments.

Norm
Gtrist, kinsey, festive: weeph needs your help on setting up networked lasers on SCO in:
https://www.experts-exchange.com/bin/Show.10382156

I'm sure you can help ;)