Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


Print

Tool

SYNTAX

Print [file1 [file2]… | <redirectedFile] [-b] [-b2] [-bm n[.n]]
[-c[opies] n] [-dialog] [-f[ont] name] [-ff string] [-from n] [-h]
[-hf[ont] name] [-hs[ize] n] [-l[ines] n] [-lm n[.n]] [-ls n[.n]]
[-md] [-n] [-nw n] [-p] [-page n] [-ps file] [-q quality] [-r]
[-rm n[.n]] [-s[ize] n] [-t[abs] n] [-title name] [-tm n[.n]]
[-to n]

DESCRIPTION

The Print tool prints one or more text files on the printer selected with the Choose tool.

In addition to using the default print settings, Print allows you to modify the printing behavior. You can

specify the number of copies to print (-c[opies])

display a standard print dialog box to control printing (-dialog)

specify a different font name and size (-f[ont], -s[ize])

print from page n to page n (-from and -to)

set the top, bottom, left, and right margins (-tm, -bm, -lm, -rm)

number lines and pages (-n and -page)

set the print quality (-q)

set the tabs (-t[abs])

Note
You can also apply Print options to the Print Window/Print Selection menu item by placing them in the exported {PrintOptions} MPW Shell variable, which is initially set to -h in the Startup file. •

INPUT

One or more files specified on the command line. Print also accepts standard input as long as it has been redirected (using < or |). Print does not accept input entered interactively.

OUTPUT

Sends output to the currently selected printer. Print does not send any information to standard output.

ALIAS RESOLUTION

This command resolves Finder aliases in all input file specifications.

STATUS

Print can return the following status codes:

0

no errors

1

parameter or option error

2

execution error

PARAMETERS

file1 [file2]…

Specifies one or more text files to be printed.

OPTIONS

-b

Prints a rectangular border around the printable area of the page. Headers (-h) are placed inside the border, separated from the body text by an extra line.

-b2

Prints an alternate form of the above border in which the header appears above and outside the border.

-bm n[.n]

Sets the bottom margin to n inches (default = 0).

-c[opies] n

Prints n copies of the file or selection.

-dialog

Displays a standard print dialog. You can then use it to control the printing parameters. Any settings that are made apply to all files being printed in that call of Print.

-f[ont] name

Sets the font to name (for example, Courier). Normally Print uses the font indicated in the resource fork of the specified files. If none is indicated there, it uses Monaco 9 point. See also -s[ize].

Note that printing with a font that is not directly supported by the printer is significantly slower than printing with a built-in font.

Note
The Print tool does not allow you to set fonts different from the ones built into the LaserWriter unless you click the Font Substitution checkbox in the LaserWriter Page Setup dialog box. •

-ff string

Inserts a page break when the specified string is encountered at the beginning of a line. If string is the only item on a line, that line is omitted. If the string is followed by additional characters, the additional characters are printed on the first line of the new page.

-from n

Print pages starting from n. Normally Print starts with the first page of the file.

-h

Prints page headers at the top of each page. The header indicates the date and time of printing, the name of the file, and the page number.

-hf[ont] name

Specifies the header font (-h). Normally Print uses the same font for headers as it uses for the rest of the file.

-hs[ize] n

Specifies the header font size in points (default = 10). Normally Print uses the same font size for headers as it uses for the rest of the file.

-l[ines] n

Prints up to a maximum of n lines per page. Line spacing is adjusted so that the full page is used. If you specify both -l and -ls, -l takes precedence.

-lm n[.n]

Sets the left margin to n inches (default = 0.2778). This gives the appropriate margin width for three-hole punched pages.

-ls n[.n]

Sets the line spacing (default = 1). A value of 1 indicates single spacing, 2 indicates double spacing, and so on. Fractional values are permitted.

-md

Prints the file's modification date, rather than the date and time of printing, in the header. To use this option you must also specify -h.

-n

Numbers lines, placing the numbers to the left of the printed text. Line numbers are not normally printed.

-nw n

Specifies the width of the line number (-n) field in characters, where n is a value between -10 and 10 (default = 5). Negative values for n cause the field to be zero padded.

-p

Writes progress information to diagnostic output, indicating which files are printing and the number of lines and pages printed.

-ps file

Sends PostScript commands in the specified file to the LaserWriter prior to printing each page.

-page n

Numbers the pages of the file, beginning with n. Page numbers normally start with 1.

-q quality

Sets the print quality on an ImageWriter printer. The value of quality can be any of the following strings:

high
standard
draft

Note
This option is ignored if it is not supported by the selected printer. •

-r

Prints pages in reverse order.

-rm n[.n]

Sets the right margin to n inches (default = 0).

-s[ize] n

Prints with the specified font size. Normally Print uses the font size indicated in the resource fork of the text files, and if none is present, it uses 9 point.

-t[abs] n

Sets the tab value. If you do not specify this option, Print takes the tab setting from the resource fork of the file, and if none is present, it takes the tab setting from the {Tab} variable.

-title name

Uses name as the title when printing headers (- h). Normally Print uses the name of the text file as the title.

-tm n[.n]

Sets the top margin to n inches (default = 0).

-to n

Prints pages up to n. The Print tool normally continues to the last page of the file.

EXAMPLES

In this example, the command line prints the contents of the Test file in Courier font with a default font size of 9 points.

Print Test -font Courier

The following command line prints the Startup and UserStartup files with page headers. When printed, the files appear more compressed than usual due to the smaller font size (Monaco 8 instead of 9) and decreased line spacing (.85 instead of 1).

Print Startup UserStartup -h -size 8 -ls 0.85

The following command line prints print.p with borders, with headers in Helvetica® 12, and with pages in reverse order.

Print print.p -b -hf Helvetica -hs 12 -r

SEE ALSO

Choose

 
 


Last Updated July 2000