From: John Caywood (caywood@wyvern.wyvern.com)
Date: 03/18/93


From: caywood@wyvern.wyvern.com (John Caywood)
Subject: Re: Help with Printers
Date: 19 Mar 1993 01:49:24 GMT

Sean Gum (Sean.Gum@f34.n343.z1.fidonet.org) wrote:
: Ok, another stupid question. Using Linux with an HP Compatible laser
: printer, how do you get Linux to send Carriage Returns? I get it to send
: a line feed, but no carriage return. So stuff get splatted all over the
: place. Anybody help? Thanks in advance!
I have an HP DeskJet 500 (not quite a LaserJet, but....)

Look in the bak of the owner's manual; there is a chart of the HP PCL
commands. Under the heading Line Termination, you will see several
choices. I tried several, and the one that worked was listed as
        CR-->CR, LF-->CR+LF,FF-->CR+FF
to get the which behavior you must send (on the DJ)
        <Escape>&k2G

A few (hundred) postings back, someone posted a C program to send this
escape sequence -- it can be done with an ascii file. Can't speak for
emacs or joe, but in vi you enter <ctrl>v<escape> to get an escape.
Create a file with vi (or your favorite editor) and put into it the
escape sequence. Send it to the printer with lpr (or cat file > /dev/lp?
if you prefer), and you'll be set. Ditto with any other commands listed
in the manual.

Here is the file i developed (just tonite, in fact) to send 66-line
pages (e.g., man pages) to a DJ 500. Just put <ctrl>v<esc> in instead
of the 5-character sequence <Esc>.
DeskJet Settings:

Reset: <Esc>E

General
Line termination: <Esc>&k2G CR-->CR, LF-->CR+LF, FF-->CR+FF
Line wrap: <Esc>&s0C On

Page setup (66-line page, 1-inch left margin, must be set in order shown)
Paper size: <Esc>&l2A US letter
Orientation: <Esc>&l0O Portrait
Line spacing: <Esc>&l6D 6 lpi
Page length: <Esc>&1l66P 66 lines
Perforation skip: <Esc>&l0L Off
Clear: <Esc>9
Margin left column: <Esc>&a9L 1-inch from left, 1/4 in printer,
                                        plus 9 more 12 cpi characters
Margin right column: <Esc>&a86M 3/4-inch from right, 6-1/2-inch
                                        print width
Top margin: <Esc>&l0E 0 lines
Text length: <Esc>&l63F 63 lines
Text scale: <Esc>&k6W On
                                        Scale 66 lines into 63-line spacing

Set font (must be set in the order shown)
Character set: <Esc>(10U PC-8
Character spacing: <Esc>(s0P Fixed
Print pitch: <Esc>(s12H 12 cpi
Style: <Esc>(s0S Upright (Roman)
Stroke weight: <Esc>(s0B Normal
Typeface: <Esc>(s6T Letter Gothic

P.S.: I'm partial to Letter Gothic myself -- you can do whatever.

-- 
 "If you've always done it that way, it's probably wrong"
 --------------------------------------attributed to Edward Kettering
 John Caywood, aspiring Linux S.A.,    ! caywood@wyvern.wyvern.com
         vi bigot, and wine drinker    ! J.S.Caywood@LaRC.NASA.GOV