This chapter describes how to print to a line printer. The chapter also provides information on how to use the mp utilities to print to a PostScript printer or to a line printer.
From the command line, you can print one of two ways:
Directly to a line printer
Using the mp utilities to convert text to bitmapped graphics
The Traditional Chinese Solaris operating environment uses EUC code sets. Its printing applications (such as desktop tools) generate PostScript code that uses EUC. If you use different PostScript printing, make sure it has the same capabilities.
To print an EUC file, use the following command:
system% lp EUC-filename |
To print a Big5 format file on a printer that supports this format, use the following command:
system% lp -d Big5_printer Big5-filename |
For more information on setting up the Big5 filter, see Traditional Chinese Solaris System Administrator's Guide.
To print a file that contains Traditional Chinese characters in EUC format on an Epson® dot matrix printer, use the following command:
system% lp -d Epson_printer EUC-filename |
As a print filter, mp generates a properly formatted version of contents in PostScript format. The PostScript output file contains glyph images from Solaris-resident scalable or bitmap fonts, depending on each locale's system font configuration for mp. The mp filter is enhanced in the current Solaris release to print files with different encoding text in the corresponding Asian locales.
The following command line will print a file containing Traditional Chinese characters, with or without ASCII/English characters:
system% mp -L $LANG filename | lp -d printer |
The file may contain ASCII/English characters as well as Traditional Chinese. Refer to the mp(1) man page for more detailed information.
You can use the mp utility as a filter because mp accepts the stdin stream.
system% cat filename | mp | lp |
You can set the utility as a printing filter for a line printer. For example, the following command sequence tells the printer service LP that the printer lp1 accepts only mp format files. This command also installs the printer lp1 on port /dev/ttya. See the lpadmin(1M) man page for more details.
system% lpadmin -p lp1 -v /dev/ttya -I MP system% accept lp1 system% enable lp1 |
You can add the lpfilter utility for a filter by using the lpfilter(1M) command as follows:
system% lpfilter -f filtername -F pathname |
The lpfilter command tells lp that a converter (in this case, xutops) is available through the filter description file named path name. The pathname can be determined as follows:
Input types: simple Output types: MP Command: /usr/bin/mp |
The filter converts the default type file input to PostScript output using/usr/bin/mp.
To print a UTF-8 text file, use the following command:
system% lp -T MP UTF-8-file |
For more details on the mp command, refer to the mp(1) man page.
When used as an Xprt client, mp can print the output of any printer connected to a network supported by an Xprt print service. As an Xprt client, mp supports PostScript and many versions of PCL.
The Xprt client attempts a connection to an Xprt server based on the following rules:
When the -D printer_name@machine[:dispNum] or -P printer_name@machine[:dispNum] options are used with the mp command, mp attempts to connect to an Xprt print service on machine[:dispNum] with printer_name.
If the above attempted connection to machine[:dispNum] fails or if the argument given to -D or -P is just printer_name, then the mp command checks the XPSERVERLIST for Xprt servers that support the printer_name argument. For example:
system% setenv XPSERVERLIST "machine1[:dispNum1] machine2[:dispNum2] machine3[:dispNum3]" |
If no server is found using above rules, mp checks for an XPDISPLAY environment variable set to machine[:dispNum]. For example:
system% setenv XPDISPLAY "machine[:dispNum]" |
If the XPDISPLAY variable is not set or if the variable is invalid, mp tries to connect to the default display :2100. If the default display value is also invalid, mp exits with an error message.
The /usr/lib/lp/locale/C/mp directory contains .xpr print page sample layout files for Xprt client. The sample files are for 300 dpi printers. If the target printer has a different dpi value, the dpi value of the sample files is automatically converted to the resolution of the target printer.