.TH MPAGE Local 2/2/96

.SH NAME
mpage \- print multiple pages per sheet on PostScript printer

.SH SYNOPSIS
\fBmpage [\-1248cfovlaAHOERSUXrt] [\-p[prprog]] [\-B[textboxmargins]] [\-da|p]
[\-m[sheetmargins]] [\-M[pagemargins]] [\-Llines] [\-Wwidth] [\-C[encoding]
[\-hheader] [\-P[printer]] [\-j first[\-last][%interval] [\-stabstop]
[\-Ffontname] [\-zprintcommand] [\-Zprintcommand_args] [\-Ddateformat]
[\-bpapersize] [files...]



.SH DESCRIPTION
.I Mpage
reads plain text files or PostScript documents and prints them on a
PostScript printer with the text reduced in size so that several
pages appear on one sheet of paper.  This is useful for
viewing large printouts on a small amount of paper.
Uses ISO 8859.1 to print 8-bit characters.

.PP
The following options are recognized (note that arguments to options may be
separated from the option by spaces, except for -B, -m, -M, -p and -P):

.TP
.B -8
Print 8 normal pages per sheet.

.TP
.B -4
Print 4 normal pages per sheet
.IR (default) .

.TP
.B -2
Print 2 normal pages per sheet.

.TP
.B -1
Print 1 normal page per sheet (included for symmetry).

.TP
.B -O
Print 2 normal pages per sheet. But, this option will print
every first and forth page of every set of four pages.
This option will ignore the
.B -a
and
.B -l
options.

.TP
.B -E
Print 2 normal pages per sheet. But, this option will print
every second and third page of every set of four pages.
This option will ignore the
.B -a
and
.B -l
options.

.TP
.BI -p [prprog]
Pipe input through 
.I prprog
command (including specified options) before printing
(assumes the input is a text file).
When no command is specified, it defaults to
.BR pr ( 1 ).

.TP
.B -c
Toggle Concatenation off pages from different files on single sheets
.RI ( default
off).

.TP
.BI -C [encodingfile]
Specify then character encoding file. Default is none.
The should be in the mpage library directory (/usr/local/lib/mpage).
Mpage has an internal default encoding based on Latin-1 or IBM codepage 850.
Depending on
compile time option this encoding definition is on or not. Not specifying
an encodingfile will toggle the usage of the internal encoding.

.TP
.BI -D dateformat
Set the date format as in 
.I strftime(3)
to be used in date/time representations (e.g. in headers).

.TP
.B -o
Toggle printing of outlines around each reduced page
.RI ( default
on).

.TP
.B -v
Toggle printing a count of the number of sheets
produced for printing
.RI ( default
off) .

.TP
.B -f
Toggles folding lines longer than page width
.RI ( default
off) .

.TP
.BI -F fontname
Specify font. Default is Courier.

.TP
.B -l
Toggle printing landscape or portrait mode.
Landscape pages are 55 lines long by 132 characters wide by default. 
Portrait pages are 66 lines long by 80 characters wide by default.
.RI ( default
portrait) . 

.TP
.B -R
Switch to left to right mode, starting first page on left bottom corner.
This might be useful for landscape postscript files.
(Note: using the
.B -l
option after
.B -R
undoes the -R, and switches to normal landscape mode.

.TP
.BI -B [<num>[lrtb]*]
Specify text box margins and line thickness. The default is 0 columns (lines)
for both left and right (top and bottom) margins and 0 line thickness.
Specifying 
.B -B 
solely toggles printing of the box. 
.IR l ,
.IR r ,
.I t
or
.I b
set the left, right, top or bottom margin respectively to 
.I <num>
columns (lines).
Not specifying any of the sides, will set the line thickness when 
.I <num> 
is given. For example
.BI -B 1
sets the line thickness to 1.
Sides with negative margins will not print.

.TP
.BI -m [<num>[lrtb]*]
Specify sheet margin. The default margin is 20 points. Specifying 
.B -m 
solely sets left margin to 40 points. 
.IR l ,
.IR r ,
.I t
or
.I b
set left, right, top or bottom margin respectively to 
.I <num>
points.
Not specifying any of the sides, will set all sides when 
.I <num> 
is given.
.I <num>
defaults to 40 points. For example
.BI -m 10
sets all margins to 10 points.
.BI -m l50tb
sets left margin to default 40 and top and bottom margin to 50 points.
.BI -m 50l25bt30r
set bottom and top margin to 25, left margin to 50 and
right margin to 30 points. Margins can have negative numbers.
Very large values have funny effects. This is left as an exercise to the 
user.

.TP
.BI -M [<num>[lrtb]*]
Specify logical page margins. For syntax, see 
.B -m
option.
Defaults are 4 for 
.B -M 
option solely, and 8 for 
.IR <num> .
Margins can be negative. This way large white borders
in your (postscript) documents canbe reduced.
Very large values have funny effects. This is left as an exercise to the 
user.

.TP
.B -a
Toggle layout of the pages on the sheet so that successively numbered pages run
down the sheet, as opposed to left to right.
.RI ( default
updown) .

.TP
.BI -d a|p
Force input to be taken as ascii (a) or postacript (p) text. This way you
can print your postscript code as text, or print postscript code that
mpage does not recognise. When using
.B -dp ,
make sure that the the postscript code contains
.I %Page
page separators or else things will probably look odd.


.TP
.B -A
.BR deprecated ,
see /fB-b/fP option. Prepare output for European A4 sized paper. For default see 'mpage -x'.

.TP
.B -U
.BR deprecated ,
see /fB-b/fP option. Prepare output for US Letter sized paper. For default see 'mpage -x'.

.TP
.BI -b papersize
Prepare output for selected paper size. Papersize can be \fIA4\fP for
European A4, \fILetter\fP for US Letter or \fILegal\fP for Legal
sized paper.  For default see 'mpage -x'.

.TP
.B -S
Accept non-square page reduction.  By default, pages are shrunk equally in
X and Y, even if this wastes some space on the sheet.  With \fB\-S\fP, 
reduced pages are larger but slightly distorted. (only used when printing
postscript files.)

.TP
.B -r
Reverse printing.  The last sheet is printed first.  The way of arranging
reduced pages on the sheets doesn't change.

.TP
.B -t
Toggle printing on both sides of the paper. This will toggle duplex mode
of the printer.  Use this option only if your printer is capable of
printing in duplex mode. 
.RI ( default
off).

.TP
.B -T
Toggle tumble of every second pages when printing in duplex mode. Use this
option only if your printer is capable of printing in duplex mode and together
with
.B -t . 

.TP
.BI -j first[-last][%interval]
Print just the selected sheets, specified by number, starting at 1.
Here \fIlast\fP defaults to the end of data, \fIinterval\fP to 1.
Thus \fB-j\fI1\-10\fR selects the first 10 sheets, while
\fB-j\fI 1%2\fR prints just the odd-numbered sheets and \fB-j\fI 2%2\fR
prints just the even ones.
.sp
You can do double-sided printing, in two passes, as follows.
If you use 3-hole punched paper, put it in the printer such that the holes
will appear at the top of the page -- on the right as you pull out the
printer tray, in our Laser writer II NTX.
Print the odd-numbered sheets with
.sp
.ti +5
mpage ... -j 1%2 ...
.sp
Note the number of pages it reports.  (Only half this many will really
be printed).  When printing finishes, if mpage reported an
\fIodd\fP number of pages, remove the last one from the stack, since there will
be no even-numbered sheet to match it.  Then arrange the stack of paper for
printing on the other side.
(If it's punched, the holes will now be on the left.)
On our II NTX, the paper comes out blank-side up; replace it in the tray still
blank-side up but rotated 180 degrees.  For other printers, you figure it out.
Now print the even-numbered sheets in reverse order with
.sp
.ti +5
mpage ... -r -j 2%2 ...
.sp
hoping no one else reaches the printer before you do.

.TP
.BI -P [printer]
Specify the printer to which the PostScript output will be sent
(e.g.lpr -Pprinter). Using
.B -P
with no printer specified will send the PostScript to the default printer
queue (e.g. lpr). Using -P- will return output to stdout, useful in
combination with MPAGE environment variable. Without
.B -P
output will be send to standard output.

.TP
.BI -L lines
Adjust the page reduction parameters so that
.I lines
lines will fit in the space of one page.
This overrides the default values normally supplied.  (See the
\fB-l\fI\ option\fR.)
If used in conjunction with the
.B -p
option then this value is passed to the pr program as well.

.TP
.BI -W width
Adjust the page reduction parameters so that a line
.I width
characters long will fit in the space of one page.
This overrides the default values normally supplied.  (See the
\fB-l\fI\ option\fR.)
If used in conjunction with the
.B -p
option then this value is passed to the pr program as well.

.TP
.BI -I indent
Indent text by 
.I indent
characters.

.TP
.BI -s tabstop
Set tabstop width (default 8 characters). Should by >= 2.

.TP
.BI -h header
This is used only when the 
.B -p
or
.B -H
switch is used and is passed as the "\fB-h\fI\ header\fR" option to
.BR pr ( 1 )
or as the header for \fB-H\fR.

.TP
.B -H
Create header line for each logical page separated from page text by a
horizontal line. Unless
.B -h
is given, the header consist of last file
changetime, filename and page number, all in bold and slightly larger font.
This option only applies to non-postscript files.

.TP
.B -X [header]
Print header centered on each physical page (sheet). If no header is given,
the default is the current filename (note the
.B -c
option) on the left and the page number on the right.

.TP
.BI -z printcommand
Specify command to use to send output to. Default is 
.B lpr .
 for UCB style spooler,
.B lp
for ATT style spooler.
You can specify command line options, but see 
.B -Z
option. For example \fB-zlp\fR for system V Unix.

.TP
.BI -Z printprog_queuename_arg
Specify what option to use for the "\fB-z\fI\ printcommand\fR" to specify
a printqueue.
For example \fB-zlp -Z-d\fR for system V Unix.
Default is
.B -P
for UCB style spooler,
.B -d
for ATT style spooler.

.PP

.SH ENVIRONMENT
.I Mpage
examines the
.B PRINTER
(or 
.B LPDEST
for ATT style spooler)
environment variable to override its default printer.

.PP
The
.B MPAGE_LIB
environment variable can be used to control where the character 
encodings (\fB-C\fR) can be found.

.PP
.ne 10
.I Mpage
also examine the
.B MPAGE
environment variable for default option settings.  Any option or
combination of options can be specified in the
.B MPAGE
environment variable.  For example, if MPAGE is set to the string:
.in +1i
.B -2oPqms -L60
.br
.in -1i
it would (in the absence of other command line arguments) print 2
pages per sheet, 60 lines per page, with outlines, on the printer
named
.B "qms"
(overriding the
.B PRINTER\fR/\fBLPDEST
environment variable, if it exists.)  In the environment variable,
white space is used as an option delimiter, and no quoting is
recognized.

.PP
Any command line options will override both the
.B PRINTER
and 
.B MPAGE
environment variables.

.SH FILES
/bin/pr	/bin/fold
.br
/usr/tmp/mpageXXXXXX

.SH BUGS
.PP
Suffers under the burden of far too many switches.  (But
.B I
wanted the choices!) 
.PP
Many others, w're sure.
.SH VERSION
Version 2.4, Released September 1996.
.SH AUTHORS
Mark P. Hahn (uunet!pyrdc!mark), Pyramid Technology Corporation

Marcel Mol <marcel@mesa.nl>. Lots of other changes. More or
less the main author now.

Help from many others, pleas see the CHANGES file.
