Operating System - HP-UX
1833332 Members
3044 Online
110051 Solutions
New Discussion

LP Remote to Sun/Xerox causing embedded characters

 
Doug_3
Frequent Advisor

LP Remote to Sun/Xerox causing embedded characters

We have a problem with remote print. We can ftp a text file with PCL 5 codes to a sun which acts as a printer control work station for a Xerox docutech printer. I set up a remote print queue to this machine. (we have no other remote printers)

According to Xerox, the lpr process must be embedding control characters into the file causing it to not print correctly. It will print the first line correctly, the second line starts one line below and just after the last character of the first line:

page one line one herexxx
page one line two here

Xerox won't help, stating the issue is with our HP lpr. I set this up via sam.

Ideas?

Thanks in advance,
Doug
8 REPLIES 8
Bill Douglass
Esteemed Contributor

Re: LP Remote to Sun/Xerox causing embedded characters

Sounds like your file contains line feeds to terminate each line, while the printer wants a CR/LF (charrage rutran and line feed pair).

How is the print queue on your Sun box set up? Often times a printer will provide both a raw print queue that does no translation, and a text queue that converts terminating LF to CR/LF. Directing print-outs to the test queue would automatically solve your problem.

Also, you could convert the file before sending it off to be printed, using a tool like ux2dos to do the LF -> CR/LF conversion.
Doug_3
Frequent Advisor

Re: LP Remote to Sun/Xerox causing embedded characters

Thanks Bill, but if I ftp the file to the server it prints just fine. I invoke the normal lp -dxerox file.txt. When rlpdaemon is called to send the file to the remote server/lp it must be altering it somehow. I am assuming it is how the rlpdaemon is configured.

Doug
Geoff Wild
Honored Contributor

Re: LP Remote to Sun/Xerox causing embedded characters

Is it possible to print directly to the printer? We have some Lexmark printers like that and required installing software from them: Lexmark 4.6 Lexmark Software for UNIX(R) Systems

Maybe Xerox has the same for HP-UX.

Unless of course the printer does not have an ip address...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Paul Sperry
Honored Contributor

Re: LP Remote to Sun/Xerox causing embedded characters

you need the driver for the printer. I got mine from www.xerox.com. Follow the links Support & Drivers, Printers, then find the model

Search for UNIX and Drivers and download the PrinterPkgXPXX.tar file

Frank Slootweg
Honored Contributor

Re: LP Remote to Sun/Xerox causing embedded characters

How did you do the FTP to the server? Did you specify/check it was a "bin"ary transfer? If it was an "ascii" transfer, then that probably explains why it worked.

Anyway, humour (sp?) us and do:

cat file.txt | ux2dos | lp -d

and report the results.

Sean OB_1
Honored Contributor

Re: LP Remote to Sun/Xerox causing embedded characters

Paul,

What model printer was this? I can't find any Unix drivers for our docutech printer.

Can you post a link for the driver?
Jeff Schussele
Honored Contributor

Re: LP Remote to Sun/Xerox causing embedded characters

Hi Doug,

the lp process does not embed any characters *in* the print job nor prepend/append any as well. It sends the data raw to the remote print server.

All you need to do is get into the menu on that printer & find in it's config the setting about LF & change it to LF=LF+CR. We have to do this to almost all type laser printers - including HP LaserJets.

Winblows boxes automatically send CR+LF - UNIX boxes ONLY send LF & the printer is doing exactly what it's told. This *won't* screw up any Windoze jobs because the ptr will only modify the LF & not touch the LF+CR

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Bill Hassell
Honored Contributor

Re: LP Remote to Sun/Xerox causing embedded characters

Whatbyou are seeing is absolutely normal for Unix files. Each ASCII file consists of text followed by LF (also known as the end-of-line character). When you send this file to a remote printer, no processing is done at all, so you see stairstep output. The reason ftp works is that you may be defaulting to an ASCII transfer which will rewrite the file at the remote end in a manner defined by the remote computer system. For instance, DOS/Windows defines an ASCII file with CR+LF as the line termination code.

So your files must be preprocessed for the printer. As Jeff mentioned, your printer may be smart enough to treat LF=CR+LF but this may cause problems with binary files. The best solution is to pipe all ASCII files through the conversion filter ux2dos:

ux2dos some_ASCII_file | lp -dremote_printer

As a note, there is no lpr command with HP-UX. HP-UX has a SysV print spooler so the command is lp and printer scripts define printer options. In a BSD system, lpr is the print command and a file called printcap defines printer features. These are very different philosophies and require special treatment when mixing systems using remote spooling.

(for the nit-pickers: /usr/bin/lpr is actually a wrapper script for lp)


Bill Hassell, sysadmin