Previous Table of Contents Next


Check the Printer Type

If you used the wrong printer type when you set up the printer with the LP print service, inappropriate printer control characters may be sent to the printer. The results are unpre-dictable: Nothing may print, output may be illegible, or output may be printed in the wrong character set or font.

Use the following steps to check the printer type:

1.  Become superuser.
2.  Type lpstat -p printer-name -l and press Return. A list of the printer characteristics appears.
elm% lpstat -p pinecone -l
printer pinecone is idle. enabled since Wed Jan 2 18:20:22 PST 1991.
available.
     Content types: PS
     Printer types: PS
     Description:
     Users allowed:
         (all)
     Forms allowed:
         (none)
     Banner not required
     Character sets:
         (none)
     Default pitch:
     Default page size:
elm%

If the printer type is not correct, become superuser and type lpadmin-p printer-name -T printer-type and press Return.

Check the stty Settings

Many formatting problems can result when the default stty (standard terminal) settings do not match the settings required by the printer. The following sections describe what happens when some of the settings are incorrect. Read the printer documentation to determine the correct stty settings for the printer port.


NOTE:  If a printer is connected by a parallel port, the baud setting is irrelevant.

To display the current stty settings for the printer port, type stty -a < device-name and press Return. The current stty settings for the printer port are displayed.

elm# stty -a </dev/term/a
speed 96ØØ baud;
rows = Ø; columns = Ø; ypixels = Ø; xpixels = Ø;
eucw 1:Ø:Ø:Ø, scrw 1:Ø:Ø:Ø
intr = ^c; quit = ^ | ; erase = ^?; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
parenb -parodd cs7 -cstopb -hupcl cread -clocal -loblk -parext
-ignbrk brkint -ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3
elm#

To change the stty settings, type lpadmin -p printer-name -o “stty=options and press Return.

You can change more than one option setting by including the options in single quotation marks and separating them by spaces. For example, suppose the printer requires you to enable odd parity and set a 7-bit character size. You would type a command such as the following:

#lpadmin -p clobber -o “stty='parenb parodd cs7'”

The stty option parenb enables parity checking/generation, parodd sets odd parity generation, and cs7 sets the character size to 7 bits.

To send a document to the printer, type lp -d printer-name filename and press Return. Look at the document to verify that it is printing correctly.

Table 11-10 shows the default stty options used by the LP print service's standard printer interface program.

Table 11-10 Default stty Settings Used by the Standard Interface Program

Option Meaning
9600 Set baud rate to 9600.
cs8 Set 8-bit bytes.
-cstopb Send 1 stop bit per byte.
-parity Do not generate parity.
ixon Enable XON/XOFF (also known as START/STOP or DC1/DC3).
opost Do "output post-processing."
-olcuc Do not map lowercase to uppercase.
onlcr Change line feed to carriage return/line feed.
-ocrnl Do not change carriage returns into line feeds.
-onocr Output carriage returns even at column 0.
nl0 No delay after line feeds.
cr0 No delay after carriage returns.
tab0 No delay after tabs.
bs0 No delay after backspaces.
vt0 No delay after vertical tabs.
ff0 No delay after form feeds.

Use Table 11-11 to choose stty options to correct various problems affecting print output.

Table 11-11 stty Options to Correct Print Output Problems

stty Values Result Possible Problem from Incorrect Setting
300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400 Sets baud rate to the specified value (enter only one baud rate) Random characters and special characters may be printed and spacing may be inconsistent.
oddp Sets odd parity Characters are randomly missing or appear incorrectly.
evenp Sets even parity
-parity Sets no parity
-tabs Sets no tabs Text is jammed against right margin.
tabs Sets tabs every eight spaces Text has no left margin, is run together, or is jammed together.
-onlcr Sets no return at the beginning of lines Text has incorrect double spacing.
onlcr Sets return at beginning of lines Zigzags print down the page.


Previous Table of Contents Next