Poster of Linux kernelThe best gift for a Linux geek
MP

MP

Section: User Commands (1) Updated: 12 April 2002
Local index Up
 

NAME

mp - POSTSCRIPT pretty printer  

SYNOPSIS

mp [ -a4 ] [ -addhdr type ] [ -alias name ] [ -allhdrs ] [ -article ] [ -bottom # ] [ -bsdprint ] [ -chars # ] [ -columns # ] [ -config name ] [ -content ] [ -copies # ] [ -digest ] [ -elm ] [ -flip ] [ -folder ] [ -forcepage ] [ -from ] [ -help ] [ -landscape ] [ -left # ] [ -linelength # ] [ -modtime ] [ -name appname ] [ -newpage ] [ -nobanners ] [ -noburstpage ] [ -number ] [ -onesided ] [ -organiser type ] [ -pagelength # ] [ -portrait ] [ -postscript ] [ -printer name ] [ -prologue name ] [ -remhdr type ] [ -right # ] [ -subject text ] [ -tab # ] [ -text ] [ -top # ] [ -tumble ] [ -twosided ] [ -us ] [ -version ] [ -words # ] [ -wrap ] [ filename ... ]

The version of mp installed at your site might also support the command line options from the previous version. These are:

mp [ -A4 ] [ -F ] [ -PS ] [ -US ] [ -a ] [ -d ] [ -e ] [ -f ] [ -l ] [ -m ] [ -o ] [ -p prologue ] [ -s subject ] [ -tm ] [ -ts ] [ -v ] [ -? ] [ filename ... ]

Use the -help command line option to determine if these options are supported.  

DESCRIPTION

The mp program reads each filename in sequence and generates a prettified version of the contents in POSTSCRIPT format. By default the output is sent to standard output. If you use one of the different names, output is sent direct to the printer.

The program will use the PRINTER or LPDEST environment variables to determine which printer the output is sent to.

If no filename argument is provided, mp reads the standard input. If the standard input is a terminal, input is terminated by an EOF signal, usually Ctrl-D.

Mail items, news articles, ordinary ASCII files, complete mail folders, and digests are all acceptable input formats for mp. The output format includes grayscale lozenges containing banner information at the top and bottom of every page.

The program is conveniently used in conjunction with the print button of the SunView/xnews(1) mailtool(1) programs, or the pipe command provided by mail(1). Add the following two lines to your .mailrc file:

set printmail='mp -printer'
set cmd="mp -printer &"

Source the .mailrc file, and you are ready to use mp. For printing ordinary ASCII files, the following alias (to be placed in your .cshrc file) may also prove useful:

alias print 'mp -text -printer -subject "\!*" <\!*'
 

OPTIONS

-a4
Use A4 paper size (8.5 x 11.4 inches). The default paper size is none, in which case mp will try to fill the paper.
-addhdr type
Add type to the list of mail or news headers to be printed.
-alias name
The user name alias that should be printed out in the mp banner heading, to show who the output is for. This will override the NAME environment variable and the users entry in the password file.
-allhdrs
If set, then print out all mail or news headers.
-article
Format the file as a news article. The top banner contains the text: "Article from newsgroup ", where newsgroup is the first news group found on the Newsgroups: line. By default, the input files are assumed to be mail messages.
-bottom #
The size (in points) for the bottom margin on each page. There are approximately 72 points per inch. The default value is 8 points.
-bsdprint
If set, then assume this is a BSD system, and use the appropriate print command, and command line options. The default value for this option is false.
-chars #
The maximum number of characters to extract from the gecos field of the users /etc/passwd entry. The default is 40.
-columns #
Number of columns of output per page. This value will override the default value in the prologue file.
-config name
The name of an alternate X resource configuration file, which will be read by mp at startup time. The default name is $HOME/.mpdefaults
-content
Instead of using "\nFrom" to denote the start of new mail messages, mp will look for (and use) the value of the Content-Length: mail header. If the Content-Length doesn't take you to the next "\nFrom", then it's wrong, and mp falls back to looking for the next "\nFrom" in the mail folder.
-copies #
Number of copies of each file to output. This option only works when the filenames to print are given on the command line. The default number of copies is 1.
-digest
Format the file as a digest.
-elm
Assume the ELM mail frontend intermediate file format. Used when printing messages from within ELM (using the "p" command), especially for printing tagged messages. This option must be specified in your ELM option setup.
-flip
Flip the top and bottom banners on the output. By default, the banners are not flipped.
-folder
Format the file as a mail folder, printing multiple messages. By default, this option is not set.
-forcepage
Always start a new page (rather than a new column) when in landscape or multi-page personal organiser mode.
-from
Instead of printing who the mail article is for, the top header will contain who the mail article is from. A useful option for people with their own personal printer.
-help
Print the usage message for mp
-landscape
Format output in landscape mode. Two pages of text will be printed per sheet of paper. By default, output will be in portrait mode.
-left #
The size (in points) for the left margin on each page. There are approximately 72 points per inch. The default value is 8 points.
-linelength #
Maximum number of characters on each line of output. This value will override the default value in the prologue file.
-modtime
Use the files last modification time (rather than the current time) in the mp banner. Note that this only works when the files are supplied on the command line (as opposed to standard input).
-name appname
Use this name, when looking for X resources for this application.
-newpage
Always start a new sheet of paper for each new file when printing in duplex mode.
-nobanners
Don't print a header and a footer banner on each page. By default, banners will be printed.
-noburstpage
If the output is destined for a printer, than the printing of the burst page is disabled. Most of the information that typically appears on the burst page sheet is output in the mp banners. By default, a burst page will be printed.
-number
Print the line number on each line output. This option is not set by default.
-onesided
Print the output in simplex (one-sided) mode. The default is to print in duplex (two-sided) mode.
-organiser type
Format the file for use with the given organiser type. Valid organiser types are filofax, franklin, proplan, timeman, tsintl and tspartner
-pagelength #
Maximum number of lines on each page of output. This value will override the default value in the prologue file.
-portrait
Format output in portait mode. One page of text will be printed per sheet of paper. This is the default value.
-printer name
Send output to the named printer. Otherwise send output to the printer named in the PRINTER or LPDEST environment variables.
-ps
If the mail or digest message just has PostScript as the text of the message, then this is normally just passed straight through. Specifying this option, causes PostScript to be printed as text.
-prologue name
Employ the file name as the POSTSCRIPT prologue file, overriding any previously defined file names.
-remhdr type
Add type to the list of mail or news headers which will not be printed.
-right #
The size (in points) for the right margin on each page. There are approximately 72 points per inch. The default value is 8 points.
-subject text
Use text as the new subject for the printout. If you are printing ordinary ASCII files which have been specified on the command line, the subject will default to the name of each of these files. Note that as mp automatically assumes the default input file format is a mail file, you will have to include the -text command line option to make this happen.
-tab #
The number of spaces to output when encountering a tab character. The default value is 8.
-text
Format the file as an ordinary ASCII text file. By default, the file is assumed to be a mail message.
-top #
The size (in points) for the top margin on each page. There are approximately 72 points per inch. The default value is 8 points.
-tumble
If printing in duplex mode, adjust the alignment of the reverse page. By default, the reverse page is not tumbled.
-twosided
Print the output in duplex (two-sided) mode. This is the default. This obviously only works if the printer is capable of printing on both sides of the paper.
-us
Use US paper size (8.5 x 11 inches). The default paper size is none, in which case mp will try to fill the paper.
-version
Print the version number of this release of mp.
-words #
The maximum number of words to extract from the gecos field of the users /etc/passwd entry. The default is 3.
-wrap
Wrap words onto the next line of output. By default, this option is not set.
 

RESOURCES

On startup, mp will use the following X resources which by default are stored in $HOME/.mpdefaults. Note these resource names will be prepended with the running application name (mp, newsp, mailp ...). This means that you can have different sets of resources for each type of program.

Resource: addHeaders
Values:
Headers to add (string)
Description
A comma separated list of the extra headers that mp should print out.

Resource: aliasName
Values:
Text string (NULL).
Description
The user name alias that should be printed out in the mp banner heading, to show who the output is for. This will override the NAME environment variable and the users entry in the password file.

Resource: allHeaders
Values:
True, False (False)
Description
If set to true, then all mail or news headers are printed out.

Resource: bottomMargin
Values:
positive integer (8)
Description
The size (in points) for the bottom margin on each page. There are approximately 72 points per inch.

Resource: bsdPrinter
Values:
True, False (False)
Description
If set to true, then it is assumed that this is a BSD system, and the appropriate printer command and command line options are used.

Resource: copies
Values:
positive integer (1)
Description
The number of copies to be printed for each file.

Resource: doubleSided
Values:
True, False (True)
Description
Determines whether the output will be printed on one side of the paper or two. Obviously for two-sided output to work, the printer has to support it.

Resource: elmMail
Values:
True, False (False)
Description
If set to true, assumes the ELM mail frontend intermediate file format.

Resource: fileType
Values:
Mail, News, Postscript or Text (Mail)
Description
Describes the type of the input file to be processed. Either mail messages, news articles, pure PostScript or plain text files.

Resource: flipBanners
Values:
True, False (False)
Description
If set to true, flips the top and bottom banners on the output.

Resource: forcePage
Values:
True, False (False)
Description
If set to true, always starts a new page (rather than a new column) when in landscape or multi-page personal organiser mode.

Resource: leftMargin
Values:
positive integer (8)
Description
The size (in points) for the left margin on each page. There are approximately 72 points per inch.

Resource: lineLength
Values:
positive integer (80)
Description
The maximum number of characters printed on each line.

Resource: mailDigest
Values:
True, False (False)
Description
If set to true then mp assumes the input is in the form of a mail digest.

Resource: mailFolder
Values:
True, False (False)
Description
If set to true then mp assumes the input is a file containing more then one mail message, and processes (and prints) each in turn.

Resource: nameChars
Values:
1-255 (40)
Description
The maximum number of characters to extract from the gecos field of the users /etc/passwd entry.

Resource: nameWords
Values:
1-255 (3)
Description
The maximum number of words to extract from the gecos field of the users /etc/passwd entry.

Resource: newPage
Values:
True, False (False)
Description
If set to true, and printing duplex (two-sided), then printing of each new file is started on a new sheet of paper.

Resource: numberColumns
Values:
positive integer (1)
Description
The number of columns of output per page. This value will override the default value in the prologue file.

Resource: numberLines
Values:
True, False (False)
Description
If set to true then mp will number each line of output.

Resource: organiserType
Values:
Filofax, Franklin, Proplan, Timeman, Tsintl or Tspartner
Description
Describes the personal organiser output format.

Resource: outputType
Values:
Portrait, Landscape or Organiser (Portrait)
Description
Describes the printed output format. Either portrait, landscape or one of the special personal organiser formats.

Resource: pageLength
Values:
positive integer (66)
Description
The maximum number of lines printed on each page.

Resource: paperSize
Values:
None, A4 or US (None)
Description
Describes the size of the paper the the output will be printed on.

Resource: printHeaderPage
Values:
True, False (False)
Description
If set to true then a burst banner page will be printed at the beginning of the mp output.

Resource: printerName
Values:
Text string (NULL)
Description
The name of the printer to send output to. If no name is supplied, then mp will use the default printer.

Resource: prologueName
Values:
UNIX pathname (NULL)
Description
Use this as the prologue filename overriding any previously defined file names.

Resource: removeHeaders
Values:
Headers to remove (string)
Description
A comma separated list of the standard headers that mp should not print out.

Resource: rightMargin
Values:
positive integer (8)
Description
The size (in points) for the right margin on each page. There are approximately 72 points per inch.

Resource: subject
Values:
Text string (NULL)
Description
The subject that will be printed out in the banner for each file printed.

Resource: tabSize
Values:
positive integer (8)
Description
The number of spaces to output when encountering a tab character.

Resource: topMargin
Values:
positive integer (8)
Description
The size (in points) for the top margin on each page. There are approximately 72 points per inch.

Resource: tumble
Values:
True, False (False)
Description
If set to true and printing in duplex mode, adjust the alignment of the reverse page.

Resource: useContent
Values:
True, False (False)
Description
If set to true, instead of using "\nFrom" to denote the start of new mail messages, mp will look for (and use) the value of the Content-Length: mail header. If the Content-Length doesn't take you to the next "\nFrom", then it's wrong, and mp falls back to looking for the next "\nFrom" in the mail folder.

Resource: useFrom
Values:
True, False (False)
Description
If set to true, instead of printing who the mail article is for, the top header will contain who the mail article is from. A useful option for people with their own personal printer.

Resource: useModTime
Values:
True, False (False)
Description
If set to true, use the files last modification time (rather than the current time) in the mp banner.

Resource: wrapWords
Values:
True, False (False)
Description
If set to true, wrap words onto the next line of output.

 

ENVIRONMENT VARIABLES

The default output printer is determined by looking at the PRINTER environment variable for BSD systems or the LPDEST environment variable for System V systems.

An alternative file containing the mp X resources can be given with the MPDEFAULTS environment variable.

The mp prologue file is determined by first looking for the environment variable MP_PROLOGUE, which specifies the directory where mp prologue files are to be found. If MP_PROLOGUE is not found, then the default directory is assumed (LIBDIR/mp.pro.ps).

 

SUPPLIED PROLOGUE FILES

The following prologue files are provided:
mp.pro.ps
Used by default
mp.pro.l.ps
Used by the -landscape landscape mode option
mp.pro.ff.ps
Used if the -filofax option is in effect
mp.pro.fp.ps
Used if the -franklin option is in effect
mp.pro.pp.ps
Used if the -proplan option is in effect
mp.pro.tm.ps
Used if the -timeman option is in effect
mp.pro.tsi.ps
Used if the -tsintl option is in effect
mp.pro.tsp.ps
Used if the -tspartner option is in effect
mp.pro.alt.ps
An alternative modification of the default prologue file which outputs the page number in the right corner of the bottom banner.
mp.pro.altl.ps
An alternative landscape option mode prologue file.
 

FILES

.cshrc
initialization file for csh(1)
.mailrc
initialization file for mail(1)
$HOME/.mpdefaults
X resource initialisation file.
BINDIR/mp
executable
LIBDIR/mp.pro.ps
POSTSCRIPT prologue for mail printing
LIBDIR/mp.pro.l.ps
POSTSCRIPT prologue for landscape format
LIBDIR/mp.pro.alt.ps
alternative "default" POSTSCRIPT prologue, inserts page numbers in the bottom right corner of each page
LIBDIR/mp.pro.altl.ps
alternative "landscape" POSTSCRIPT prologue.
LIBDIR/mp.pro.ff.ps
POSTSCRIPT prologue for Filofax format
LIBDIR/mp.pro.fp.ps
POSTSCRIPT prologue for Franklin Planner format.
LIBDIR/mp.pro.tm.ps
POSTSCRIPT prologue for Time Manager format
LIBDIR/mp.pro.tsi.ps
POSTSCRIPT prologue for Time/System (International) format
LIBDIR/mp.pro.tsp.ps
POSTSCRIPT prologue for Time/System (Partner) format
 

SEE ALSO

mail(1), mailtool(1), xnews(1)  

AUTHORS

Original version by Steve Holden.

Converted to C then C++, modified and maintained by Rich Burridge, Sun Microsystems Inc.

Original modified to handle net news articles and MH mail by Bruno Pillard, Chorus Systemes, France.

Handling of mail digests added by Dave Glowacki of Public Works Computer Services, St Paul, MN.

Original manual page revised by Rick Rodgers, UCSF School of Pharmacy, San Francicso.

Support for Personal Organiser printing style added by Douglas Buchanan, Sun Microsystems Europe.

Substantial modifications to header parsing by Jeremy Webber, Computer Science Department, University of Adelaide, Australia.

Support for printing multiple files and subject line filename print for ordinary ASCII files added by Sam Manoharan, Edinburgh University.

Support for landscape mode written by Michael Tuchiarone.

Revision of the POSTSCRIPT structuring and the way that the prologue files are handled was included by Johan Vromans.

New style POSTSCRIPT prologue files by John Macdonald.

Support for the ISO8859 character set by Bertrand DeCouty.

Rich Burridge.  MAIL: Rich.Burridge@Sun.Com


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
RESOURCES
ENVIRONMENT VARIABLES
SUPPLIED PROLOGUE FILES
FILES
SEE ALSO
AUTHORS

This document was created by man2html, using the manual pages.
Time: 21:24:02 GMT, April 16, 2011