Operating System - HP-UX
1822430 Members
3384 Online
109642 Solutions
New Discussion юеВ

No carriage return when printing

 
SOLVED
Go to solution
Rick Stoneking
Occasional Contributor

No carriage return when printing

I am new to UNIX and I am trying having a problem with printing a text file to a network printer. The printer is a HP LJ 8000 series and what happens is that when I print there appears to be no carriage return, only a line feed, at the end of a line. The next line starts on character to the right of the previous line (and quickly runs off the page into never never land). I have looked in the books that I have, and perused the man page for the lp command, as well as looking at the printer options in the /etc/lp/interfaces/ file with no luck. Any help would be greatly appreciated.

Rick
4 REPLIES 4
Eric Hess
Advisor

Re: No carriage return when printing

Are you using HP JetDirect. If so you are more than likely using the wrong driver for that printer.
I didn't do it. He did!
Jordan Bean
Honored Contributor
Solution

Re: No carriage return when printing


How was the queue created? lpadmin or hppi? If through SAM, please identify which option was used. Please attach the interface script (/etc/lp/interface/). While we're playing around, try this:

ux2dos | lp

This will convert all newlines to CRLF.

The printer should have a configurable setting that governs how it handles EOL. For HP LJ 4000s, it is under "Printing Menu" and is called "Append CR to LF?" Set it to YES.

Bill Hassell
Honored Contributor

Re: No carriage return when printing

Since you have an HP LaserJet printer, you probably have an HP JetDirect network card installed. The problem is that you installed the printer on HP-UX as a remote printer, not a network printer. A remote printer is designed to use the RFC 1179 LPD protocol which performs no translation between foreign systems and an ASCII file on Unix has nothing but LF's at the end of each line.

The network software on HP-UX is called HP Printer Installer (HPPI) and is downloaded from:

http://h20000.www2.hp.com/bizsupport/TechSupport/Product.jsp%3Flocale%3Den_US%26prodTypeId%3D13037%26prodSubCatId%3D28674

(sorry for the ugly URL) Select your version of HP-UX (10.20 or 11.xx) and install it using swinstall. Then to add the printer, first remove the old printer definition using:

lpshut
lpadmin -xOldPrinterName

Then run the command:

addqueue -h IP-addr-of-printer -q printqueue-name

If addqueue is not found, use the full path:
/opt/hpnpi/bin/addqueue

The lp man page won't help because there are so many different ways to connect a printer. See the man page for net_lj5x for all the options that can be used with your printer.


Bill Hassell, sysadmin
Jeff Schussele
Honored Contributor

Re: No carriage return when printing

Hi Rick,

The simplest solution is to turn on CR+LF on the printer itself. Go into the printer's menu - it's usually in the "Printing Menu" & you're looking for "Append CR to LF" or such.
This essentially translates LF to CR+LF on print jobs. Since Windows print jobs always send CR+LF there will be no impact to it's print jobs.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!