lpr(1) lpr(1) NAME

lpr - Sends files to spooling daemon for printing

SYNOPSIS

lpr [flags] filename

FLAGS

The lpr flags -c, -d, -f, -g, -l, -n, -p, -t, and -v are used to notify the

line printer spooler that the files are not standard text files; therefore these flags are mutually exclusive. The spooling daemon uses the appropri- ate filters to print the data if you specify one of these flags.

[Digital] In an international environment, the lpr command needs locale

information to use the appropriate filter to print a text file. The -A flag

allows you to specify, among other things, locales for text files and printers.

The lpr command supports the following flags:

-A "option_list"

[Digital] Specifies one or more country-specific options, separated by spaces. For a list of valid options, refer to the Country-Specific Options section.

-c Assumes that the files contain data produced by the cifplot filter.

-C class

Specifies a print class as the request classification on the burst page.

-d Assumes that files contain data from tex (DVI format from Stanford

University).

-f Interprets the first character of each line as a standard FORTRAN car-

riage control character.

-g Assumes that files contain standard plot data as produced by plot rou-

tines.

-h Suppresses the printing of the burst page.

-i [number]

Indents the output number spaces. If number is not given, the indenta-

tion is 8 spaces.

-Itray

Selects the input paper tray that supplies paper for the print job. The tray name is printer dependent. The following list shows the valid

tray variable values for the printers that support the -I flag:

ln05 and ln05r printers:

cassette, upper, or manual

ln06 and ln06r printers:

upper, envelope_feeder, lower, or manual

ln07 and ln07r printers:

upper, manual, lower, or cassette

ln08 and ln08r printers:

envelope_feeder, mmf, manual, upper, lower, or lcit

ln14 printer:

front, manual, upper, or lower

ln10ja (Japanese-specific) printers:

upper, lower, or manual

dl1152 printers (supported only for Asian language printing):

front, manual, or cassette

dl5100 printers:

envelope_feeder, front, manual, internal, or upper

For more information on the input options, refer to the documentation for your printer. If you have one of the previously listed printers connected locally,

there are two additional forms of the -I flag. You can specify the

flag in the form -Itray_name, where the tray_name variable specifies

the name of a tray that is supported by the particular printer (for

example, -Ilettertray). You also can specify the flag in the form -In,

where the n variable specifies an integer value. Refer to your printer

documentation for information on specifying valid tray selections.

-j Causes the request ID of the printer request to be displayed on stan-

dard output after it is entered in the print spooling queue.

-J name

Specifies the request name to appear on the burst page. Normally, the

lpr command uses the name of the first file.

-Ksides

Prints the job in a way specified by the sides variable. You can

specify sides as follows:

1 or one_sided or one_sided_simplex

Prints only on one side of the sheet.

2 or two_sided or two_sided_duplex

Prints on both sides of the sheet; the second side is reached by flipping the sheet about its left edge, as in the binding of a book.

tumble or two_sided_tumble

Prints on both sides of the sheet, but prints the opposite way up on each side, so the second side can be read by flip- ping the sheet along its top axis.

one_sided_duplex

Prints only on one side of the sheet, but retains the page

layout intended for two_sided_duplex printing. The layout

refers to such things as where the margins are and where the page numbers are.

one_sided_tumble

Prints only on one side of the paper, but retains the page layout intended for tumble printing.

two_sided_simplex

Prints on two sides of the paper, but retains the page layout

intended for one_sided_simplex printing.

-l Prints control characters and suppresses page breaks.

-m Sends mail (see the mailx(1) reference page) when spooling is com-

pleted.

-n Assumes that files contain data output by the ditroff (device-

independent troff) command.

-Nnumber

Prints one or more pages on one sheet of paper. The printer automati- cally adjusts to handle the number of pages printed on one sheet of paper. The maximum that may be specified is 100 pages.

-on Selects the output tray where the printed job will be deposited. The n

variable specifies an integer value that depends on the printer. Refer to your printer documentation to determine the correct values.

-Oorientation

Prints the page in the way specified by the orientation variable, which

can be the following:

portrait The printed output is parallel to the short side of the page.

landscape The printed output is parallel to the long side of the page.

-p Formats the files using pr as a filter.

-Pprinter

Specifies printer as the output device (print job destination). If you

do not specify the -P flag, the default printer or the value of the

PRINTER environment variable is used.

-r Removes the file when spooling or printing is completed.

-s Uses symbolic links to print. Usually, files are copied to the spool-

ing directory, but the -s flag uses symlink() to link data files,

rather than trying to copy them. This allows you to print large files.

If you specify the -s flag, files should not be modified or removed

until they have been printed. Note that the -s flag disables codeset

conversion that may be necessary when printer and file locales differ,

even when you explicitly specify different plocale and flocale values

with the -A flag.

-t Assumes that files contain data output by the troff (cat photo-

typesetter) command.

-T title

Specifies the title to be used by the pr command instead of the

filename. The -p flag also must be specified.

-v Assumes that the files contain a raster image for devices like the Ben-

son Varian.

-wnumber

Defines the page width for the pr command.

-x Assumes the files do not require filtering before printing.

-#number

Produces number copies of the output.

-1 font, -2 font, -3 font, -4 font

Mounts the specified font on font position 1, 2, 3, or 4, respectively. DESCRIPTION

The lpr command uses the lpd spooling daemon to print files.

If you specify a hyphen (-) for a file name, the lpr command reads from

standard input; this can be used in conjunction with specified file names.

If you do not specify a particular printer with the -P flag, the default

printer or the value of the PRINTER environment variable is used.

To check the status of a printer, use either the lpq or lpstat command. To

cancel printer requests, use the lprm or cancel command.

Country-Specific Options

[Digital] The -A flag allows you to specify options that are required to

print files in various native languages and also supports some country- specific printers. Each option includes a keyword, most of which require a

value assignment. See i18n_printing(5) for a general description of

country-specific support and to determine which options may be required for particular languages and printers.

Note

You may need to use the wwlpspr command in place of the lpspr and

lpr commands when sending Asian language files to a PrintServer

printer. See wwlpspr(1) if you are sending files to a

PrintServer printer.

The -A flag options are supported by software installed by optional world-

wide support subsets. In other words, a country-specific option will not work unless an associated country-specific software subset is installed.

For the lpr command, the following options can be included through the -A

flag:

flocale=locale_name

Specifies the locale for the source text file. Print filters use this

locale to validate the characters in the text. If the flocale option

is not set, the text is interpreted in the current locale. The flocale

setting is particularly important for correct interpretation of charac-

ters in multibyte codesets. Moreover, if the plocale option is also

set, the lpr command automatically converts characters from the text

file codeset to the printer codeset before printing the file. For example, the following command converts a file created in a Traditional Chinese locale from the Big 5 codeset to the DEC Hanyu codeset before printing it:

% lpr -A "flocale=zh_TW.big5 plocale=zh_TW.dechanyu" big5.txt

plocale=locale_name

Specifies the locale for the printer. Some printers, like the LA380- CB, are country-specific and have builtin fonts encoded in a particular codeset. For example, the builtin fonts for the LA380-CB printer are

encoded in DEC Hanzi. For these printers, the codeset part of the plo-

cale value should match the codeset (dechanzi) of the printer's builtin

fonts. Other printers are generic and suitable for use with files in a variety of languages. For example, the DEClaser 5100, when used with

the dl5100wrof print filter, can handle fonts for different codesets.

For these printers, the plocale value should match the font used in the

text file. The following example prints a file encoded in DEC Hanyu by using the Sung-Light-CNS11643 font, which supports DEC Hanyu characters:

% lpr -A"font=Sung-Light-CNS11643 plocale=zh_TW.dechanyu" \

dechanyu.txt

When the plocale value is inappropriate for the font codeset, printed

output is useless. To determine printer locale for country-specific printers, refer to

i18n_printing(5). To find out which fonts are available for a particu-

lar locale, refer to the reference page for the corresponding codeset.

For example, if locale_name is zh_TW.dechanyu, see dechanyu(5) for a

list of appropriate fonts.

font=font_name

Specifies the outline font name for printing source text files on a PostScript printer. For more information, refer to the entry for the

plocale option.

length=number_of_lines

Specifies the number of lines per page. When used with the -w flag,

the length option can control the font size and orientation of the

printed output.

odldb=odl_database_path

Specifies the path of the software on-demand loading (SoftODL) database

files. The odldb option overrides the default path, which specifies

the systemwide SoftODL database. Therefore, users can set odldb to

specify private SoftODL databases. For example, the following command

directs lpr to use the SoftODL database in /usr/tmp:

% lpr -A "odldb=/usr/tmp/odl"

Refer to odl(5) for more information on SoftODL.

odlstyle=style-NxN

Specifies what SoftODL font style and size to use, for example normal-

24x24. If the odlstyle is not specified, the system default SoftODL

style and size is used. Refer to odl(5) for more information on Sof-

tODL.

spcom

Enables space-compensation mode for languages, such as Thai, that con- tain nonspacing characters. Nonspacing characters can combine with other characters for display and therefore do not occupy space. Many of the existing tools for text alignment do not handle nonspacing char- acters properly. If you want to print Thai output from such utilities, you should enable space compensation mode to ensure proper text align- ment in the printed file. Space compensation is be done line by line. The print filter keeps count of the number of nonspacing characters found in a line. When two or more consecutive spaces are encountered, the print filter inserts the appropriate number of spaces, therefore compensating for spaces added by the nonspacing characters. Space-compensation mode is valid only for printing Thai characters.

tm Enables text morphing for Thai printing. Text morphing replaces some

characters with others to produce better output in desktop publishing

environments. Refer to Thai(5) for more details on text morphing.

Text morphing rules are proprietary. Therefore, text morphing is sup- ported only by Digital Thai outline fonts and are available only for PostScript printing.

onehalf

Specifies that Thai characters be printed on one and a half lines, rather than on three lines, to produce more compressed and natural

looking output. The onehalf option works only with the thailpof print

filter. Refer to i18n_printing(5) for general information on text

morphing.

tacdata=tac_data_path

Specifies where the character code tables for the printer (thailpof

filter only) can be found. These tables are selected for use with the

yp value in the /etc/printcap file. The default path is

/usr/lbin/tac_data.

NOTES

1. DIGITAL UNIX software does not include ditroff or troff. Therefore,

files suitable for use with the -n or -t flags may not be available on

your system.

2. If you try to print too large a file, the file is truncated. The lpr

command does not print binary files. If a user other than the root

user prints a file and spooling is disabled, lpr will print a message

and will not put requests in the queue. If a connection to lpd on the

local machine cannot be made, lpr will indicate that the daemon cannot

be started.

3. Fonts for troff and text reside on the host with the printer.

Currently, it is not possible to use local font libraries. DIGITAL

UNIX does not supply troff, so local font libraries for troff may not

exist on your system. EXAMPLES

The following example prints three copies of the new.index.c,

print.index.c, and more.c files:

% lpr -#3 new.index.c print.index.c more.c

The following example prints three copies of the concatenated new.index.c,

print.index.c, and more.c files:

# cat new.index.c print.index.c more.c | lpr -#3

The following example prints Operations on the burst page instead of the

node name before printing the new.index.c file:

# lpr -C Operations new.index.c

FILES

/etc/passwd

User information

/etc/printcap

Printer description file

/usr/lbin/lpd

Line printer daemon

/var/spool/*

Spool directories

/var/spool/*/cf*

Daemon control files

/var/spool/*/df*

Data files specified in cf files

/var/spool/*/tf*

Temporary copies of cf files

/usr/lbin/tac/tac_data/*

Character encoding tables for Thai RELATED INFORMATION

Commands: cancel(1), checknr(1), lp(1), lpc(8), lpd(8), lpq(1), lprm(1),

lpstat(1), mailx(1), neqn(1), nroff(1), pr(1), tbl(1), wwlpspr(1)

Functions: symlink(2)

Others: dechanyu(5), i18n_intro(5), i18n_printing(5), l10n_intro(5),

odl(5), Thai(5)