[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Guide to Printers and Printing


PostScript Printers

PostScript is a general-purpose programming language that allows you to specify the appearance of both text and graphics on a page.

A PostScript printer is equipped with a computer that runs an interpreter for processing PostScript language files. When a PostScript printer receives a file, it runs that file through the interpreter and then prints it. Unless special provisions have been made by the manufacturer, files submitted to a PostScript printer must be written in the PostScript language.

In addition to providing excellent facilities for managing text and graphics and combining them, most major applications that support printed output support PostScript. Graphics operators facilitate the construction of geometric figures that can then be positioned and scaled with any orientation. The text capabilities allow you to specify a number of different fonts that can be placed on a page in any position, size, or orientation. Because text is treated as graphics, text and graphics are readily combined. Moreover, the language is resolution and device-independent, so that draft copies can be proofed on a low-resolution device and the final version printed in higher resolution on a different device.

Applications that support PostScript, including word-processing and publishing software, create documents in the PostScript language without intervention by the user. Thus, it is not necessary to know the details of the language to take advantage of its features. However, standard files that some applications or special terminals produce cannot be printed on a PostScript printer because they are not described in the language. The print service provides optional filters to convert many of these files to PostScript so that users can take advantage of PostScript and continue to use their standard applications, such as troff.

Retail Type 1 fonts can be installed for use with applications running on the desktop. These fonts can be downloaded to PostScript printers if the application generates PostScript output that uses them. The lp command handles this automatically using the download filter.

Using a PostScript Printer

When the PostScript printers and filters have been installed, the print service manages PostScript files like any others. If psfile is a file containing a PostScript document and psprinter has been defined to the print service as a PostScript printer, the command

lp -d psprinter -T PS psfile

schedules the print request and manages the transmission of the request to the PostScript printer.

Supporting Non-PostScript Print Requests

Because PostScript is a language and PostScript printers are expecting print requests written in that language, some applications may produce standard print requests that may not be intelligible to PostScript printers. The following are examples of print requests that may not be interpreted by some PostScript printers.

Non-PostScript Content Types


Content Type Type of Print Request
simple Print an ASCII (simple) text file
troff Print output from the troff command
daisy Print files intended for a Diablo 630 (daisy-wheel) printer
dmd Print the contents of a bit-mapped display from a terminal
tek4014 Print files formatted for a Tektronix 4014 device
plot Print plot-formatted files

Filters are provided with the print service to translate print requests with these formats to the PostScript language. For example, to convert a file containing ASCII text to PostScript code, the filter takes that text and writes a program around it, specifying printing parameters such as fonts and the layout of the text on a page.

After the PostScript filters are installed, they are invoked automatically by the print service when a user specifies a content type for a print request with the -T option. For example, if a user enters the command

lp -d psprinter -T simple report2

the ASCII file report2 (a file with an ASCII or simple format) is converted to PostScript automatically, as long as the destination printer (psprinter) is defined to the system as a PostScript printer.

Additional PostScript Capabilities Provided by Filters

The filters described in Providing Filters also take advantage of PostScript capabilities to provide additional printing flexibility. Most of these features can be accessed through the mode option (invoked by the -y option) to the lp command. These filters allow you to use several unusual options for your print jobs. The following list describes these options and shows the option to include on the lp command line for each one.

-y reverse Reverse the order in which pages are printed
-y landscape Change the orientation of a physical page from portrait to landscape
-y x=number,y=number Change the default position of a logical page on a physical page by moving the origin
-y group=number Group multiple logical pages on a single physical page
-y magnify=number Change the logical size of each page in a document
-o length=number Select the number of lines in each page of the document
-P num_list Select, by page numbers, a subset of a document to be printed, where num_list is page numbers or page ranges separated by commas (for example, 1,4,6-8,14- prints pages 1, 4, 6, 7, 8, and 14 through the end)
-n number Print multiple copies of a document

Note:  If these filters are to be used with an application that creates PostScript output, make sure that the format of the application conforms to the format of the PostScript file structuring comments. In particular, the beginning of each PostScript page must be marked by the comment

   %%Page: label ordinal

where ordinal is a positive integer that specifies the position of the page in the sequence of pages in the document, and label is an arbitrary page label.

For example, you have a file called report2 that has a content type simple (meaning that the content of this file is in ASCII format). You want to print six pages of this file (pages 4 through 9) with two logical pages on each physical page. Because one of the printers on your system (psprinter) is a PostScript printer, you can do this by entering the following command:

lp -d psprinter -T simple -P 4-9 -y group=2 myfile

The filter that groups these logical pages will try to position the pages on the physical page to maximize space utilization. Thus when you specify group=2, the pages will be printed side by side, so that the physical page will be landscape orientation. Landscape mode, which controls the orientation of the logical page rather than the physical page, would cause the logical pages to be positioned one on top of the other when combined with the group=2 option.

Supporting PostScript Printers

Support of PostScript printers is similar to support of other printers, in that the printers must be defined to the system with the lpadmin command and the appropriate software must be installed to manage them. PostScript printers may require some additional effort in supporting fonts and establishing where slow filtering occurs.

Installing and Maintaining PostScript Printers

PostScript printers, like other printers, are installed with the lpadmin command. These printers must use the PS interface program, requested by specifying -m PS on the lpadmin command line.

Note:  The printer type and content type of a PostScript printer must be consistent with the printer type used in PostScript filters. Therefore, install your PostScript printers with a printer type of PS, PS-b, PS-r, or PS-br, and a content-type of PS.

The PS printer types serve two functions. First, they cause the print service to activate the correct fast filter to communicate with the printer. PS and PS-r are used to communicate with printers connected via a serial port; PS-b and PS-br, to communicate with printers connected through a parallel port. Second, the PS interface creates a PostScript banner page for PS printers. The banner page is printed last if the printer type is PS-r or PS-br, and the pages of the document are printed in reverse order. The printer type is specified with the -T option to the lpadmin command.

PostScript Page Order Table


Printer Connection Type Page Order
PS serial normal
PS-b parallel normal
PS-r serial reverse
PS-br parallel reverse

The -b specification (used when you select PS-b or PS-br) represents batch, which is typically used for parallel connections but can also be used for serial connections if you do not want PostScript printer status messages. The PS and PS-r printer types cannot be used for parallel connections.

By specifying the -I option of the lpadmin command when configuring a PostScript printer, you can indicate which content types are handled by the printer without slow filtering. For a printer on a server system, PS is the correct content type to enter. However, for a printer on a client system, consider where slow filtering is to occur, since network and system resource management may be of concern.

By specifying valid content types other than PS, you can force the slow filtering of input to occur on the server system. Conversely, if you specify a content type of PS, the input will be filtered locally before the print request is forwarded to the server system for fast filtering and printing.

To configure a printer on a server system:

/usr/sbin/lpadmin -p ps1 -T PS-b -I PS -m PS

To configure a printer on a client system without local filtering:

/usr/sbin/lpadmin -p ps1 -T PS-b -I simple,daisy,dmd,tek4014,plot

To configure a printer on a client system with local filtering:

/usr/sbin/lpadmin -p ps1 -T PS-b -I PS

As part of the installation procedure, you may want to install fonts on the printer or downloadable fonts on the computer. See Installing and Maintaining PostScript Fonts for details.

Installing and Maintaining PostScript Filters

The PostScript filters provided cover the majority of situations. In certain circumstances, however, you may find it helpful to change the filter descriptions and install the filters differently. This section describes the location and function of these filters.

PostScript filters are contained in the directory /usr/lib/lp/postscript.

Note:  There are two types of filters: fast filters and slow filters. For definitions of these types, see lpfilter and Defining a Filter.

A prerequisite of communication between any system and a PostScript printer is the presence of the postio or the lp.cat filter on the system. Those programs are the only mandatory PostScript filters that communicate directly with the PostScript printer. The following filters allow other types of documents to be translated to PostScript and to be printed on a PostScript printer.

PostScript Filters


File Content Type Filter
simple postprint
troff dpost
daisy postdaisy
dmd postdmd
tek4014 posttek
plot postplot

The following filters perform special functions:

Special Purpose Filters


Function Filter
Communicate with printer postio,lp.cat
Download fonts download
Reverse or select pages postreverse
Matrix gray scales postmd

Installing and Maintaining PostScript Fonts

One of the advantages of PostScript is its ability to manage fonts. Fonts are stored in outline form in the Type 1 format, either on the printer or on a computer that communicates with a printer. When a document is printed, the PostScript interpreter generates each character as needed (in the appropriate size) from the outline description of it. If a font required for a document is not stored on the printer being used, it must be transmitted to that printer before the document can be printed. This transmission process is called downloading fonts.

Fonts are stored and accessed in several ways.

The print service provides a special download filter to manage fonts using the last method in the list.

The print service can use troff width tables for the 35 standard PostScript fonts that reside on many PostScript printers, for use by the dpost program.

Obtaining a List of Printer-Resident Fonts

Most PostScript printers come equipped with fonts resident in the printer ROM. Some printers have a disk on which additional fonts are stored. A list of the Type 1 fonts in ROM or on disk of an attached PostScript printer can be obtained from the printer manufacturer's documentation. For PostScript printers attached through a serial port, a list of these fonts can also be generated using the postio command and a PostScript program, romfonts.ps.

To obtain a list of printer-resident fonts for a PostScript printer attached to a serial port, do the following:

  1. Obtain the device on which the PostScript printer is connected:

    lpstat -v
    

    Given a system on which the PostScript printer prlocal is attached through a serial port, this command would return output similar to the following:

       device for prlocal: /dev/tty01
    

    This output shows the printer to be attached on device /dev/tty01.

  2. As root user, run these commands:

    cd /usr/lib/lp/postscript
    

    postio -L /tmp/postio.o -l /dev/tty01 -t romfonts.ps
    

    For our sample prlocal printer, this will produce output in the file /tmp/postio.o that looks similar to the following:

    	   printer startup
    	   %%[ status: waiting; source: serial 25 ]%%
    	   %%[ status: endofjob ]%%
    	   %%[ status: idle ]%%
    	   sending file romfonts.ps
    	   waiting for end of job
    	   %%[ status: busy; source: serial 25 ]%%
    	   /AGaramond-Bold
    	   /AGaramond-BoldItalic
    	   /AGaramond-Italic
    	   /AGaramond-Regular
    	   /AvantGarde-Book
    	   /AvantGarde-BookOblique
    	   /AvantGarde-Demi
    	   /AvantGarde-DemiOblique
    	      . . . more PostScript font
    names . . .
    	   /ZapfChancery-MediumItalic
    	   /ZapfDingbats
    	   %%[ status: endofjob ]%%
    	   job complete
    	
    

    This example lists the printer-resident fonts for prlocal.

Adding Printer-Resident Fonts to a Printer's Font List

When a printer is installed, the list of printer-resident fonts should be added to the font list for that printer. This font list file can be edited to contain only the font names in the printer's memory (AGaramond-Bold through ZapfDingbats, in the previous example), and placed into the file /etc/lp/printers/prlocal/residentfonts to prevent downloading of these fonts from the host computer.

To add printer-resident fonts to a printer's font list, do the following:

  1. Navigate to the printer administration directory in which the font lists are kept. For a particular printer, this font list is contained in the file

    /etc/lp/printers/printer-name/residentfonts
    

    where printer-name is the name of the printer.

    With the -p option, download checks this file to see what Type 1 fonts are ROM-resident and disk-resident (some PostScript printers have directly attached fonts disks) in the printer so that it does not download such fonts.

  2. This file is not automatically created when a PostScript printer is first set up on your system using the lpadmin command. You may need to create this file yourself. (Font-list files must be edited manually; that is, with the help of a text editor such as vi.)

    When fonts are permanently downloaded to the printer, add the font names to this file. (This will prevent fonts from being downloaded when they are already on the printer, a time-consuming procedure.)

    Note:  If the printer is attached to a remote system, this list should include fonts which reside on that system and are available for downloading to the printer. This prevents fonts from being transmitted unnecessarily across a network.

Installing and Maintaining Host-Resident Fonts

Some fonts will be resident on the host and transmitted to the printer as needed for particular print requests. As the administrator, it is your job to make PostScript fonts available to all the users on a system. To do so, you must know how and where to install these fonts, using the guidelines described previously. Because fonts are requested by name and stored in files, the print service keeps a map file that shows the correspondence between the names of fonts and the names of the files containing those fonts. Both of these must be updated when fonts are installed on the host.

To install host-resident PostScript fonts, do the following:

  1. Copy the font file to the appropriate directory.

    The fonts available for use with PostScript printers reside in the directory /usr/share/lib/hostfontdir or other directories.

  2. Add to the map table the name of the font and the name of the file in which it resides.

    Also in the hostfontdir directory, you (the administrator) must create and maintain a map table that shows the correspondence between the name assigned to each font by the foundry (the company that created the font) and the name of the file in which that font resides. A file name that begins with a slash (/) is used as is; otherwise the pathname is relative to the host font directory. Comments in the map table are introduced by % (as in PostScript) and extend to the end of the line.

    For example, to map the font called Palatino Bold, add the following line to the map table:

       Palatino-Bold /usr/share/lib/hostfontdir
    

    (The map table itself is in the file /usr/share/lib/hostfontdir/map.)

    After this entry exists in the map table on your system, your users will be able to have a Palatino Bold font used in their print jobs. When they submit for printing a file containing a request for this font, the print service will prefix a copy of the file /usr/share/lib/hostfontdir to that file before sending it to the printer, as long as it is not defined in the residentfonts file.

  3. If you will be using troff, you must create new width tables for this font in the standardtroff font directory.

Downloading Host-Resident Fonts

When the PostScript document contains a request for fonts not loaded on the printer, the download filter manages this request. This filter is invoked as a fast filter; it downloads fonts automatically if the fonts reside on the same system as the printer. The download filter may also send fonts to a remote printer. To do this, you can create a new filter table entry that calls the download filter as a slow filter through the -y option. Alternatively, you may force selection of this filter by changing the input type.

The download filter does five things:

Font Cartridges and Character Sets

Printers differ in the way they print different font styles. Some have font cartridges, while others have preprogrammed, selectable character sets.The print service can minimize the impact of these differences on the users of the print service.

You can specify which font cartridge or character set is available with each printer. When you list the font cartridges or character sets available, you assign names to them. These names are for your convenience and the convenience of the users on your system. Because different printers might have similar font cartridges or character sets, use common font names on all printers. This allows a user to submit a file for printing and request a particular font style, without requiring that the user know which printer is used or whether a font cartridge or selectable character set is used.

If the printer has mountable font cartridges, you only need to list their names. If the printer has selectable character sets, you must list their names and map each set to a name or number that uniquely identifies the set in the terminfo database.

Specifying Character Sets

For printers that allow selectable character sets, determine the names of the character sets and then map each set to a name or number in the terminfo database.

To determine the names of the character sets listed in the terminfo database, enter:

   tput -T printer-type csnm 0

printer-type is the name of the printer type in question. This command should display the name of the 0th character set (the character set obtained by default after the printer is initialized).

To display the names of the other character sets, repeat the command above, replacing 0 with 1, 2, 3, and so on.

In general, the terminfo names should closely match the names used in the user documentation for the printer. However, because not all manufacturers use the same names, the terminfo names may differ from one printer type to the next.

To specify a list of character set names and to map them into terminfo names or numbers, type:

   /usr/sbin/lpadmin -p printer_name -S characterset_list

characterset_list is a list of names, separated by commas or spaces. If you use spaces to separate the names, enclose the entire list (but not the -S) in quotes. Each item in the list is a character set name mapping (alias) that looks like one of the following:

   csN=characterset_name
   characterset_name1=characterset_name2

N is a number between 0 and 63 that identifies the number of the character set in the terminfo database. characterset_name1 identifies the character set by its name in the terminfo database. In both instances, the name to the right of the equal sign (=) is the name you choose as an alias of the character set.

Note:  You do not have to provide a list of aliases for the character sets if the terminfo names are adequate. You can refer to a character set by terminfo name, by number, or by your alias.

For example, your printer has two selectable character sets (sets #1 and #2) in addition to the standard character set (set #0). The printer type is 5310. Enter the following commands to determine the names of the selectable character sets:

   tput -T 5310 csnm 1
   english
   tput -T 5310 csnm 2
   finnish

The words english and finnish, which are the names of the selectable character sets, are the output of the commands. The name finnish is adequate for referring to character set 2, but better names are needed for the standard set (set 0) and set 1. Type the following command to define synonyms:

   /usr/sbin/lpadmin -p printer_name -S "cs0=american, english=british"

The following three commands will then produce identical results. (The lp command routes print jobs to the printer, and in these examples, routes the print job to any printer capable of handling the cs1 character set.)

   lp -S cs1 -d any . . .
 
   lp -S english -d any . . .
 
 
   lp -S british -d any . . .

If you do not list the character sets that can be used with a printer, the service assumes a printer that has selectable character sets can take any csN name or terminfo name known for the printer.

To remove the character set mappings, type:

   /usr/sbin/lpadmin -p printer_name -S none

Specifying Font Cartridges to Use With a Printer

Until you specify the font cartridges that can be used with a new printer, the print service does not consider any font cartridges installable on that printer and rejects any print requests that require a font cartridge.

To specify a list of font cartridges to use with a printer, ype:

   /usr/sbin/lpadmin -p printer_name -S font_cartridge_list

font_cartridge_list is a list of font cartridge names, separated by commas or spaces. If you use spaces to separate the names, enclose the entire list (but not the -S) in quotes. These are the only font cartridges considered installable on the printer.

To remove the font cartridge list from the printer, type:

   /usr/sbin/lpadmin -p printer_name -S none

After you specify the list of font cartridges installable on the printer, you can install them. See Changing a Font Cartridge on a Printer.

Changing a Font Cartridge on a Printer

Before the print service prints a file that requires a font cartridge, you must install and mount the font cartridge on the printer.

If you have set up alerting for the font cartridge, the print service alerts you when enough print jobs are queued for the font cartridge to be installed and mounted. See Alerting to Mount Forms and Font Cartridges.

Changing a font cartridge involves first removing the current font cartridge from the printer. Then, install the new font cartridge on the printer and inform the print service that the new font cartridge is ready to use by mounting it. Because it is difficult to do this on a printer that is currently printing and because the print service continues to print files that do not require the font cartridge on the printer, disable the printer first.

To install or change a font cartridge, do the following:

  1. Disable the printer.
  2. Remove the current font cartridge from the printer (if applicable).
  3. Install the new font cartridge on the printer.
  4. Mount the new font cartridge by typing:

    	   /usr/sbin/lpadmin -p printer_name -M -S font_cartridge_name
    	
    

    Any print requests that require a font cartridge are printed on printer_name.

  5. Re-enable the printer.

To unmount a font cartridge, type:

   /usr/sbin/lpadmin -p printer_name -M -S none

Note:  You do not need to unmount the current font cartridge after physically removing it from the printer before installing and mounting a new font cartridge.

Setting Up Printer Fault Alerts

The print service provides a method for detecting and alerting you to printer faults. Faults can range from simple problems, such as running out of paper, ribbon, or toner, to more serious faults, such as a local power failure or printer failure. The range of fault indicators is also broad, ranging from dropping the carrier (the signal that indicates that the printer is online) to sending an XOFF or a message.

The print service itself only recognizes two classes of printer fault indicators: hangups (a loss of carrier) and excessive delays in printing (an XOFF flow-control character without a matching XON). For faults other than these, the printer service cannot determine the cause of the fault, so it cannot alert you. However, you can add filters that can detect other printer faults and inform the print service, which in turn alerts you. See ***.

To arrange for the print service to issue an alert in the event of a printer fault, type one of the following commands:

   /usr/sbin/lpadmin -p printer-name -A mail -W minutes
   /usr/sbin/lpadmin -p printer-name -A write -W minutes
   /usr/sbin/lpadmin -p printer-name -A 'command' -W minutes

The first two commands direct the print service to send you a mail message or write the message directly to your terminal, respectively, for each alert. The third command directs the print service to run the command for each alert. The shell environment currently in effect when you enter the third command is saved and restored for the execution of command. The environment includes environment variables, user and group IDs, and current directory. The minutes argument is the number of minutes between repeated alerts.

If you do not want the print service to issue an alert when a fault occurs, type the following:

   /usr/sbin/lpadmin -p printer-name -A none

If you want mail sent or a message written to another user when a printer fault occurs, use the third command with the option -A 'mail login-ID' or -A 'write login-ID'. If you do not specify a login-ID, the mail or message will be sent to your current login name. This may not be your login if you have used the su command to change it.

After a fault occurs and you start receiving repeated alerts, you can direct the print service to stop sending you alerts (for the current fault only), by running the following command:

   /usr/sbin/lpadmin -p printer-name -A quiet

Note:  Use the alert type quiet only to terminate an active alert; do not specify quiet as the alert type for a new printer.

If the printer-name is all in any of the commands discussed, the alerting condition will apply to all printers.

If you do not define an alert method, you will receive mail once for each printer fault. If you define a method without the -W option, you will be alerted once for each fault.

Specifying a Printer Fault Recovery Mechanism

Note:  This information does not apply if you are making a remote printer accessible to users on your system.

When a printer fault has been fixed and the printer is ready for printing again, the print service will recover in one of three ways:

Note:  The ability to continue printing at the top of the page where printing stopped requires the use of a filter that can wait for a printer fault to be cleared before resuming properly. Such a filter must have detailed knowledge of the control sequences used by the printer so it can keep track of page boundaries and know where in a file printing stopped. None of the filters supplied with the print service can do this. If an appropriate filter is not being used, you will be notified in an alert if recovery cannot proceed as you want.

To specify the way the print service will recover after a fault has been cleared, type one of the following commands:

   /usr/sbin/lpadmin -p printer-name -F continue
   /usr/sbin/lpadmin -p printer-name -F beginning
   /usr/sbin/lpadmin -p printer-name -F wait

These commands direct the print service to continue at the top of the page, restart from the beginning, or wait for you to enter an enable command to re-enable the printer.

If you do not specify how the print service is to resume after a printer fault, it will try to continue at the top of the page where printing stopped or, failing that, at the beginning of the print request.

If the recovery is continue, but the interface program does not stay running so that it can detect when the printer fault has been cleared, printing will be attempted every few minutes until it succeeds. You can force the print service to retry immediately by issuing an enable command.

Alerting to Mount Forms and Font Cartridges

If you have printers that accept changeable font cartridges and you have listed the font cartridges allowed on each, users can submit a print request to use a particular font cartridge. However, if the font cartridge is not mounted when a user requests to use it, the job waits in the queue until you mount the font cartridge. See Specifying Font Cartridges to Use With a Printer. If a form (or font cartridge) is not mounted when you print a file and specify that form, the job waits in the queue until you mount the appropriate form. See Mounting a Form.

In these cases, you might want to set up the print system to alert you when you need to mount a form. You can specify that you are to receive alerts when the number of requests waiting for a font cartridge or form exceeds some threshold.

To arrange for alerting to the need to mount a form, type:

lpforms -f form_name -A alert_method -Q number -W  minutes


alert_method alerting method to use (mail, write, or a desired command)
number number of waiting requests to restart alerting
minutes number of minutes between alerts

For example, to direct the print service to send electronic mail alerts every five minutes whenever the printer queue contains two or more requests for the check form and it is not already mounted, type:

   lpforms -f check -A mail -Q 2 -W 5

To arrange for alerting to the need to mount a font cartridge, type:

lpadmin -S font_cartridge_name -A alert_method -Q number -W  minutes

For example, to direct the print service to write alerts to your terminal every two minutes whenever the printer queue contains three or more requests for the dingbat font cartridge and it is not already mounted, type:

   lpadmin -S dingbat -A write -Q 3 -W 2

To arrange for alerting whenever the queue contains requests for any form or font cartridge, type one of the following:

   lpforms -f any -A mail -W 5
 
   lpadmin -S any -A mail -W 5
   

To stop receiving alert messages to mount a form or font cartridge, type one of the following:

   lpforms -f form_name -A quiet
 
   lpadmin -S font_cartridge_name -A quiet

To remove alerting when a form or font cartridge needs to be mounted, type one of the following:

   lpforms -f form_name -A none
 
   lpadmin -S font_cartridge_name -A none

If you do not define an alert method for a form or font cartridge, you do not receive an alert for it. If you define a method, but do not define the number of minutes between alerts (with the -W option), you receive one alert for each occasion.

Setting Printer Port Characteristics

Printer port characteristics are attributes defined with the -o "stty='stty-option-list'" option of the lpadmin command. Printers connected directly to computers and those connected over some networks require that the printer port characteristics be set by the interface program. These characteristics define the low level communications with the printer. Included are the baud rate; use of XON/XOFF flow control; 7, 8, or other bits per byte; type of parity; and output postprocessing. The standard interface program uses the stty command to initialize the printer port, minimally setting the baud rate and a few other default characteristics.

Default Port Characteristics

The default characteristics applied by the standard interface program are listed in the following table:

Default Description
9600 9600 baud rate
cs8 8-bit bytes
-cstopb 1 stop bit per byte
-parenb No parity generation
ixon Enable XON/XOFF flow control
-ixany Allow only XON to restart output
opost Postprocess data stream as listed below:
-olcuc Do not map lower case to upper case
onlcr Map linefeed into carriage return/linefeed
-ocrnl Do not map carriage return into linefeed
-onocr Output carriage returns even at column 0
nl0 No delay after linefeeds
cr0 No delay after carriage returns
tab0 No delay after tabs
bs0 No delay after backspaces
vt0 No delay after vertical tabs
ff0 No delay after form feeds

You may find that the default characteristics are sufficient for your printers. However, printers vary enough that you may have to set different characteristics. See the stty command for a complete list of characteristics.

If you have a printer that requires printer port characteristics other than those handled by the stty program, you will have to customize the interface program. See Printer Interface Scripts for help.

When you add a new printer, you may specify an additional list of port characteristics. The list you provide will be applied after the default list so that you do not need to include in your list items that you do not want to change. Specify the additional list as follows:

/usr/sbin/lpadmin -p printer-name -o "stty='stty-option-list'"

Note that both the double quotes and single quotes are needed if you give more than one item in the stty-option-list.

Suppose your printer is to be used for printing graphical data, where linefeed characters should be output alone, without an added carriage return. You would type the following command:

/usr/sbin/lpadmin -p printer-name -o "stty=-onlcr"

Note that the single quotes are omitted because there is only one item in the list.

As another example, suppose your printer requires odd parity for data sent to it. You would enter the following command:

/usr/sbin/lpadmin -p printer-name -o "stty='parenb parodd cs7'"

Setting Up a Printer With Multiple Names

The print service allows you to set up a single printer with multiple names to perform multiple functions. For example, if your printer supports both portrait and landscape modes, you can set up a different name for each function and then send jobs to each printer name. These multiple printers are called virtual printers.

The print spooler system differentiates printers by name only, not by the device to which the printer is connected. To specify different names for the same device and prevent multiple print jobs from appearing simultaneously, you must set up both the real printer and additional virtual printers. Thr real printer performs the actual printing and the virtual printers pass print jobs to the real printer.

For example, to set up two virtual printers, port and land, that use the capabilities of a Hewlett-Packard LaserJet, use the following procedure:

  1. Set up the real printer. Specify the Name as real and set the Model to HPLaserJet.
  2. Set up the port and land virtual printers. Set the Model to network. Specify the same Device to which real is connected.
  3. Create the file /usr/spool/lp/remote and add the following lines:

    	   port:	lp -dreal -oportrait
    	   land:	lp -dreal -olandscape
    	
    

    This specifies that when printing to printer land, the print system sends the print job to printer real using the -olandscape option (to print in landscape mode) and when printing to printer port, the print system sends the print job to printer real using the -oportrait option (to print in portrait mode).

    Note:  The options listed after -dreal depend on the printer model. Check the interface script in /usr/spool/lp/admins/lp/interface for your printer to determine the printer- or class-dependent -o options.

To print a file in landscape mode, type:

   lp -dland filename

This procedure translates the -dland option to lp to the necessary options for the printer (in this example, -dreal -ol).

Another way to accomplish this is to create a simple shell script to perform the type of printing. For example:

   :
   # Land - shell script to print in landscape mode
   #
   # syntax:  land <file> <file> ...
   #
   #
   lp -dreal -ol $@

The reasons for choosing one method over the other depend on how your applications access the print system. Many applications allow you to specify only the name of the printer, so virtual printers are the only solution. Other applications might allow complete control over the commands that submit the print job. In this case, you might use the shell script in the preceding example.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]