Inserting CR LF for a printer

Inserting CR LF for a printer

Post by Kenneth Garret » Wed, 01 Oct 1997 04:00:00



We have  HP laser printer on a LAN we have given the printer an IP
address and can print to the printer.
However when we print documents we are getting out put which appears
like this

Mary had a little lamb
                                His feet were white as snow

And everywhere that mary went

The lamb was sure to go

It seems the printer is only inserting a LF and not a CR at the end of
each line.

Is there some way to change this in UNIX using the lpadmin command?  Is
this relevant to the -m flag
for the lpadmin command?

 
 
 

Inserting CR LF for a printer

Post by Kurt J. Lanz » Wed, 01 Oct 1997 04:00:00



> We have  HP laser printer on a LAN we have given the printer an IP
> address and can print to the printer.
> However when we print documents we are getting out put which appears
> like this

> Mary had a little lamb
>                                 His feet were white as snow

> And everywhere that mary went

> The lamb was sure to go

> It seems the printer is only inserting a LF and not a CR at the end of
> each line.

> Is there some way to change this in UNIX using the lpadmin command?  Is
> this relevant to the -m flag
> for the lpadmin command?

UNIX systems use a LF for the end of the line. That's why the Laserjet
is
not seeing any CRs. Why not just walk over to the printer and use its
front panel to configure it to see a LF as CR/LF? I *know* that's an
option.
--
Kurt J. Lanza


 
 
 

Inserting CR LF for a printer

Post by Carl Gaskel » Fri, 03 Oct 1997 04:00:00


Other thoughts:

- are you using bsd spooling? you can also change some settings re
linefeeds in these settings
- could also be a setting on your printer's lan card (jetdirect? axis?)

Carl.

 
 
 

Inserting CR LF for a printer

Post by Doug Mos » Fri, 03 Oct 1997 04:00:00



> We have  HP laser printer on a LAN we have given the printer an IP
> address and can print to the printer.
> However when we print documents we are getting out put which appears
> like this

> Mary had a little lamb
>                                 His feet were white as snow

> And everywhere that mary went

> The lamb was sure to go

> It seems the printer is only inserting a LF and not a CR at the end of
> each line.

> Is there some way to change this in UNIX using the lpadmin command?  Is
> this relevant to the -m flag
> for the lpadmin command?

it's FEET WERE ? I believe it's fleece was...
I surrendered with my laserjet and wrote a c program to add a '\r' at
the end of every line.

that's in linux, but it should work in unix as I recall.  You need to
add any binary or script you write to accomplish this into your printcap
file. check the linux documents on the web.  I recall seeing a shell
script that handles that, and I believe it also explained how to set it
up in printcap too.

Later I surrendered my laserjet and got a new printer.  But not because
of the CR/LF thing.

--

One cool thing about liars...
...They always have something nice to say.

 
 
 

Inserting CR LF for a printer

Post by Tony Garc » Mon, 06 Oct 1997 04:00:00



Quote:

>We have  HP laser printer on a LAN we have given the printer an IP
>address and can print to the printer.
>However when we print documents we are getting out put which appears
>like this

>Mary had a little lamb
>                                His feet were white as snow

>And everywhere that mary went

>The lamb was sure to go

>It seems the printer is only inserting a LF and not a CR at the end of
>each line.

>Is there some way to change this in UNIX using the lpadmin command?  Is
>this relevant to the -m flag
>for the lpadmin command?

I think (for sure) your problem is in the interpretation of NL, it really
means "new line", not necessarilly CR "carriage return" (think old
typewriters). I have no idea what UNIX you are using, but, simply adding the
line "stty onlcr 0<&1" to your printer script, should fix it. Where your
setting for the printer are, depends on the UNIX flavor you're using.

It will use "stty" to translate (map) NL to NL-CR, newline, carriage return
pair. You could also set the printer to doit, but, then you could mess
something else up.

Hope this helps you,

Tony Garcia

 
 
 

1. CR <-> CR/LF <-> LF ?

        does anyone have a script that strips or adds CR or LFs to the
end of each line? I.e. translate from Mac text to Dos text/unix text and
vice versa. Thanks.

--Jauder
--
                               Jauder Ho        
                       Chaos Theory Group, Physics    


2. O C FVWM Color Icons (where to d to put them??)

3. Printing from Solaris to Novell LAN printer: How best to do LF->CR/LF translation?

4. FREE Work At Home Job Finder

5. Help; need to translate Lf to Cr-Lf for printer

6. Strange script problems in rc.firewall

7. Converting LF to CR-LF on remote printers under SYSV

8. Simple Question !!!!!!

9. LF to LF-CR on shared Windows Printer

10. How to insert cr/lf using sed or ex

11. remove LF but keep CR/LF

12. enabling 'LF->CR/LF'

13. lf vs cr/lf problem with "lp" command