Unix‎ > ‎Solaris‎ > ‎Solaris man pages‎ > ‎1‎ > ‎

mp


NAME
     mp - text to PDL (Page Description  Language)  pretty  print
     filter

SYNOPSIS
     mp [-A4] [-C] [-D target_printer_name] [-F]  [-L localename]
     [-P  target_spool_printer]  [-PS] [-US] [-a] [-c chars] [-d]
     [-e]  [-ff]  [-fp]  [-l]  [-ll]  [-m]  [-M]  [-n]  [-o]   [-
     p prologue]  [-s subject]  [-tm] [-ts] [-u config_file_path]
     [-v] [-w words] [-z point_size] [-?] [filename...]

DESCRIPTION
     The mp program, when called without the  -D  or  -P  option,
     reads  each  filename in sequence and generates a prettified
     version of the contents in PostScript format, sent to  stan-
     dard  output.  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 Control-d.

     The -D and -P options require the target printer name as  an
     argument  and produce the Page Description Language (PDL) of
     the target printer. The -D option causes the PDL  to  output
     to  stdout  and  the -P option causes the PDL to be directly
     spooled to the printer. In the absence of these options,  mp
     will product default PostScript output.

     The mp program accepts international text files  of  various
     Solaris  locales and produces output which is proper for the
     specified locale. The output will also contain  proper  text
     layout.  For instance, the output will contain bidirectional
     text rendering, and also shaping,  since  the  complex  text
     layout (CTL) is supported in mp.

     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,  or
     the outline of the same dimensions as the lozenges, contain-
     ing banner information at the top and bottom of every page.

OPTIONS
     The following options are supported:

     -a                      Formats 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.



     -A4                     Uses A4 paper  size  (8.26  x  11.69
                             inches).

     -c chars                The maximum number of characters  to
                             extract  from the gecos field of the
                             user's   /etc/passwd   entry.    The
                             default is 18.



     -C                      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 is
                             wrong, and mp falls back to  looking
                             for  the  next  "\nFrom" in the mail
                             folder.



     -d                      Formats the file as a digest.



     -D target_printer_name  Produces  the  PDL  for  the  target
                             printer.  Requires  X  Print  Server
                             connection. target_printer_name  can
                             be                            either
                             printer_name@machine[:display_number]
                             or  just  printer_name. In the first
                             form, mp tries to connect to  the  X
                             Print         Server         display
                             machine[:display_number]  with   the
                             target printer as printer_name.



     -e                      Assumes the ELM mail frontend inter-
                             mediate   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.



     -ff                     Formats the  file  for  use  with  a
                             Filofax personal organizer.




     -fp                     Formats the  file  for  use  with  a
                             Franklin Planner personal organizer.



     -F                      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.



     -l                      Formats output  in  landscape  mode.
                             Two  pages  of  text will be printed
                             per sheet of paper.



     -ll                     Formats output  in  landscape  mode.
                             One page of text will be printed per
                             sheet of paper. This is  useful  for
                             printing files with longer than nor-
                             mal lines.



     -L localename           Provides the locale of the  file  to
                             be  printed.  If  this  command line
                             option is not present, then mp looks
                             for  the  MP_LANG  environment vari-
                             able. If that is  not  present,  the
                             LANG  environment  variable is used.
                             If  none  of   these   options   are
                             present,  mp  tries to determine the
                             locale it is running in. If it  can-
                             not determine the locale, mp assumes
                             it is running in the C locale.



     -m                      Formats the file as a  mail  folder,
                             printing multiple messages.



     -M                      Forces mp to use  the  mp.conf  file
                             for   printing   output  even  if  a
                             prolog.ps  file  exists   for   that
                             locale.   Useful  when  printing  to
                             non-native PostScript printers.

     -n                      Turns off the gray bars and  associ-
                             ated  information  from  header  and
                             footer. Used to get  output  similar
                             to output of 'lp filename'.



     -o                      Formats  the  file  as  an  ordinary
                             ASCII file.



     -p prologue             Employs the  file  prologue  as  the
                             PostScript/Xprt prologue file, over-
                             riding any previously  defined  file
                             names.  This file specifies the for-
                             mat  of  the   print   output.   For
                             PostScript output, the prologue file
                             will have a .ps extension. For  Xprt
                             clients   (when  the  -D  option  is
                             specified), this file will  have  an
                             .xpr   extension.  These  files  are
                             defined  in  the  SUPPLIED  PROLOGUE
                             FILES section below.



     -P target_spool_printer Spools  the  PDL   to   the   target
                             printer.   No   output  is  sent  to
                             stdout. Requires X Print Server con-
                             nection. target_spool_printer can be
                             either
                             printer_name@machine[:display_number]
                             or just printer_name. In  the  first
                             form,  mp  tries  to  connect to the
                             display     machine[:display_number]
                             with    the    target   printer   as
                             printer_name.



     -PS                     If the mail or digest  message  just
                             has  PostScript  as  the text of the
                             message,  this  is   normally   just
                             passed  straight through. Specifying
                             this option causes PostScript to  be
                             printed as text.



     -s subject              Uses subject as the new subject  for
                             the  printout.  If  you are printing
                             ordinary ASCII files that have  been
                             specified  on  the command line, the
                             subject will default to the name  of
                             each of these files.



     -tm                     Formats the file for  use  with  the
                             Time Manager personal organizer.



     -ts                     Formats the file for  use  with  the
                             Time/System  International  personal
                             organizer.



     -US                     Uses  US  paper  size  (8.5   x   11
                             inches).  This  is the default paper
                             size.



     -u config_file_path     Specifies an alternate configuration
                             file    to    the    default    file
                             /usr/lib/lp/locale/locale_name/mp/mp.conf.
                             The  absolute file path name must be
                             used.



     -v                      Prints the version  number  of  this
                             release of mp.



     -w words                The  maximum  number  of  words   to
                             extract  from the gecos field of the
                             user's   /etc/passwd   entry.    The
                             default is 3.



     -z point_size           Prints the output text in the  point
                             size  specified  by  point_size. The
                             internal default is  12  points  for
                             portrait  printing  and 9 points for
                             landscape printing.



     -?                      Prints the usage line for mp. Notice
                             that the ? character must be escaped
                             if using csh(1).



OPERANDS
     The following operand is supported:

     filename        The name of the file to be read.



EXAMPLES
     The mp print filter can be used to print files in any locale
     that is installed in the user's machine.

     Example 1: Printing Japanese text files

     Japanese text files  encoded  in  the  euc  codeset  can  be
     printed in any non-Japanese PostScript printers by entering:

     example% mp -L ja_JP.eucJP -M ja_JP_eucJP.txt | lp

     Here, the -L option specifies the locale and the  -M  option
     invokes  the  mp.conf  configuration  file  instead  of  the
     default prolog.ps file. In the  case  of  ja_JP.eucJP,  both
     /usr/lib/lp/locale/ja_JP.eucJP/mp/mp.conf                and
     /usr/openwin/lib/locale/ja_JP.eucJP/print/prolog.ps    files
     are  present.  Therefore,  the -M option is used to override
     the precedence of the default prolog.ps file. Using  mp.conf
     as  the configuration file makes it possible to print to any
     PostScript printer.

     The encoding of the locale specifed by  the  -L  option  and
     that  of the text file to be printed have to be the same. In
     the above Japanese file example, if the text file is encoded
     in  Shift-JIS,  use  the following command, since the locale
     ja_JP.PCK is encoded in SJIS:

     example% mp -L ja_JP.PCK -M SJIS.txt | lp

     Example 2: Running in Xprt mode

     If an X Print Server daemon (/usr/openwin/bin/Xprt) is  run-
     ning in any system in the network, mp can be invoked as fol-
     lows, enabling it to output in any Page Description Language
     supported  by  Xprt  (the default value of display_number is
     2100):

     example% setenv XPSERVERLIST "machine1[:display_number1] \
         machine2[:display_number2] machine3[:display_number3]"

     or

     example% setenv XPDISPLAY machine_name[:display_number]

     Using the options -D printer_name[@machine[:display_number]]
     or   -P  printer_name[@machine[:display_number]]  gives  the
     greatest precedence and mp tries to connect to Xprt  running
     on  machine[:display_number]  with  printer_name.  When  not
     specified, the default display_number value is 2100. If this
     fails,  printer_name  is tried with an Xprt display obtained
     from the following logic. The following is also valid if you
     enter only -D printer_name or -P printer_name on the command
     line.

     mp checks XPSERVERLIST for a list  of  space-separated  Xprt
     servers  until  it finds one which supports the printer_name
     argument. If none is found, mp checks the XPDISPLAY environ-
     ment      variable,     which     is     of     the     form
     machine[:display_number]. If that is also  not  set  or  not
     valid, mp tries to connect to the default display, :2100. If
     that is also not successful, mp exits with an error message.

     To pipe the data to the target printer when XPSERVERLIST  or
     XPDISPLAY is set, enter:

     example% mp -D printer_name -L ja_JP.eucJP \
         -M ja_JP_eucJP.txt | lp -d printer_name

     For direct spooling when working in Xprt  client  mode,  use
     the -P option:

     example% mp -P printer_name -L ja_JP.eucJP -M ja_JP_eucJP.txt

     Example 3: Turning off the header and footer

     Use the -n option to turn off the mp header and footer:

     example% mp -n mytext.txt | lp

     Example 4: Printing long text lines

     Use the -ll option to print text files with longer  than  80
     column lines in landscape mode:

     example% mp -ll mytext.txt | lp

     Example 5: Specifying print point size

     Use the -z option to specify any point size, in  this  case,
     20 points:


     example% mp -z 20 mytext.txt | lp

ENVIRONMENT VARIABLES
     XPSERVERLIST    If the arguments to -D or -P is of the  form
                     printer_name@machine[:display_number],
                     XPSERVERLIST   is   used   only    if    the
                     machine[:display_number]  does  not  support
                     printer_name.

                     XPSERVERLIST contains a space-separated list
                     of  Xprt  displays  to  which to connect the
                     printer. mp goes through  the  list  sequen-
                     tially  to  get an Xprt server that can sup-
                     port the given printer, exiting at the first
                     instance  where  mp finds a display to which
                     to connect. If this is not set, the environ-
                     ment variable XPDISPLAY is used instead.



     XPDISPLAY       If the -D or -P option is specified  in  the
                     command  line  with  just  the  printer_name
                     argument and no XPSERVERLIST variable is set
                     in  the  environment, the XPDISPLAY variable
                     is      used      to      determine      the
                     machine[:display_number] running the X Print
                     Server to connect the client.  If  XPDISPLAY
                     is  also  not  set, the print server startup
                     script  starts an Xprt server at  port  2100
                     of  the machine in which the client is  run-
                     ning. The script terminates the print server
                     once  the  job is over. If XPDISPLAY is set,
                     the mp client tries  to  contact  the  print
                     server  running  at XPDISPLAY. In this case,
                     no attempt is made to start the server if it
                     is not running.



     MP_PROLOGUE     Used to determine the  directory  where  the
                     page  formatting  files  (.xpr  or  .ps) are
                     kept. These  files  determine  page  decora-
                     tions,  number of logical pages per physical
                     page, landscape or portrait format,  and  so
                     forth.  In  the  absence of MP_PROLOGUE, the
                     default  location  of   the   directory   is
                     /usr/lib/lp/locale/C/mp.



     MP_LANG
     LANG
                     If neither of the -D or -P options is speci-
                     fied,  a  prologue  file is prepended to the
                     output to be printed. The prologue  file  is
                     called
                     /usr/openwin/lib/locale/localename/print/prolog.ps
                     or
                     /usr/lib/lp/locale/localename/mp/prolog.ps,
                     where localename is the value of the MP_LANG
                     or LANG environment variable, if present. If
                     both   variables   are   present,  the  file
                     /usr/openwin/lib/locale/localename/print/prolog.ps
                     is given preference due to backward compati-
                     bility reasons. If either of these files are
                     not present, and the -D option is not speci-
                     fied, a configuration  file  of  the  locale
                     called
                     /usr/lib/lp/locale/localename/mp/mp.conf  is
                     used  as  the  source  of  the configuration
                     information that  substitutes  the  prologue
                     information  for  printing.  The presence of
                     prolog.ps disables mp.conf for backward com-
                     patibility.




EXIT STATUS
     The following exit values are returned:

     0               Successful completion.



     1               An error occurred.



SUPPLIED PROLOGUE FILES
     The following prologue files are provided.  Files  with  .ps
     extensions  are  for  the PostScript output. Files with .xpr
     extensions are for the Print Server client. .xpr  files  are
     created  for 300dpi printers and will scale to other resolu-
     tion values.

     mp.common.ps            Common prologue file for  all  other
                             .ps files in this directory.



     mp.pro.ps               Used by default.
     mp.pro.xpr

     mp.pro.ff.ps            Used if the -ff option is in effect.
     mp.pro.ff.xpr



     mp.pro.fp.ps            Used if the -fp option is in effect.
     mp.pro.fp.xpr



     mp.pro.tm.ps            Used if the -tm option is in effect.
     mp.pro.tm.xpr



     mp.pro.ts.ps            Used if the -ts option is in effect.
     mp.pro.ts.xpr



     mp.pro.alt.ps           An alternative modification  of  the
     mp.pro.alt.xpr          default  prologue file which outputs
                             the page number in the right  corner
                             of the bottom banner.




     mp.pro.l.ps             Prologue  file  used  for  landscape
     mp.pro.l.xpr            outputs.




     mp.pro.ll.ps            Prologue  file  used  for  landscape
     mp.pro.ll.xpr           outputs,  when  printing  files with
                             longer than normal lines.




     mp.pro.altl.ps          Alternate  prologue  file  used  for
     mp.pro.altl.xpr         landscape outputs.




FILES
     .cshrc

         Initialization file for csh(1).

     .mailrc

         Initialization file for mail(1).



     /usr/bin/mp

         Executable.



     /usr/lib/lp/locale/C/mp/mp.conf

         Default configuration file.



     /usr/lib/lp/locale/C/mp/mp.common.ps

         Common prologue file for all other  .ps  files  in  this
         directory. Not for .xpr files.



     /usr/lib/lp/locale/C/mp/mp.pro.ps
     /usr/lib/lp/locale/C/mp/mp.pro.xpr

         Default prologue files for mail printing.




     /usr/lib/lp/locale/C/mp/mp.pro.l.ps
     /usr/lib/lp/locale/C/mp/mp.pro.l.xpr

         Default prologue files for landscape format.




     /usr/lib/lp/locale/C/mp/mp.pro.ll.ps
     /usr/lib/lp/locale/C/mp/mp.pro.ll.xpr

         Default prologue files for  landscape  format  with  one
         column  per  page.  Useful when printing files with long
         lines.





     /usr/lib/lp/locale/C/mp/mp.pro.altl.ps
     /usr/lib/lp/locale/C/mp/mp.pro.altl.xpr

         Alternate prologue files for landscape format.




     /usr/lib/lp/locale/C/mp/mp.pro.alt.ps
     /usr/lib/lp/locale/C/mp/mp.pro.alt.xpr

         Alternative  "default"  prologue  files.   Insert   page
         numbers in the bottom right corner of each page.




     /usr/lib/lp/locale/C/mp/mp.pro.ff.ps
     /usr/lib/lp/locale/C/mp/mp.pro.ff.xpr

         Default prologue files for Filofax format.




     /usr/lib/lp/locale/C/mp/mp.pro.fp.ps
     /usr/lib/lp/locale/C/mp/mp.pro.fp.xpr

         Default prologue files for Franklin Planner format.




     /usr/lib/lp/locale/C/mp/mp.pro.tm.ps
     /usr/lib/lp/locale/C/mp/mp.pro.tm.xpr

         Default prologue files for Time Manager format.




     /usr/lib/lp/locale/C/mp/mp.pro.ts.ps
     /usr/lib/lp/locale/C/mp/mp.pro.ts.xpr

         Default prologue  files  for  Time/System  International
         format.




     /usr/openwin/lib/locale/localename/print/prolog.ps
     /usr/lib/lp/locale/localename/mp/prolog.ps
         Default locale-specific prologued file as an alternative
         to  the mp.conf file. See ENVIRONMENT VARIABLES for more
         detail on the relationship.




     The structure and format for  mp.conf  and  .xpr  files  are
     documented in the International Language Environments Guide.
     Refer to this document if you need to use  alternate  fonts,
     including  Printer  Resident  Fonts,  or if you want to make
     changes to output format.

ATTRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

     ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Availability                | SUNWmp                      |
    |_____________________________|_____________________________|


SEE ALSO
     csh(1), mail(1), mailtool(1), attributes(5)

     International Language Environments Guide










Man pages from Solaris 10 Update 8. See docs.sun.com and www.oracle.com for further documentation and Solaris information.
Comments