User Accounts, Printers, and Mail Administration
只搜尋這本書
以 PDF 格式下載這本書

Managing Character Sets, Filters, Forms, and Fonts

5

This chapter describes how to set up and administer features of the LP print service that are specific to different types of printers.
If you want to skip the background information that explains the concepts of managing these features, and proceed directly to step-by-step instructions, use the following table to find the page where the instructions for a specific task begin.
How to Set Up Hardware-Mounted or Selectable Character Setspage 136
How to Mount, Unmount, and Set Alerts for Hard Character Setspage 138
How to Add, Change, Remove, or Restore Print Filterspage 140
How to View Print Filter Definitionspage 142
How to Add, Change, or Remove a Formpage 143
How to Mount, Unmount, and Specify Alerts for Formspage 145
How to Obtain Information About Formspage 147
How to Allow or Deny User Access to Formspage 149
How to Allow or Deny Use of Forms on a Printerpage 150
How to Install Downloaded and Host-Resident PostScript Fontspage 151
If you want to review background information first, read the next section, "About Character Sets, Filters, Forms, and Fonts" on page 126.
You can refer to the following chapters and appendixes for additional information about printing:

About Character Sets, Filters, Forms, and Fonts

Depending on your site's requirements and the types of printers you have on the network, you may have to set up and administer printer-specific features of the LP print service. For example, you can assign different print wheels, filters, and forms to different printers.

Setting Up and Administering Character Sets

Printers differ in the method they use to print text in various font styles. For instance, PostScript printers treat text as graphics. These printers can generate text in different fonts, and place the text in any position, size, or orientation on the page. Other types of printers support a more limited number of font styles and sizes, using either print wheels, font cartridges, or preprogrammed, selectable character sets. Only one of these printing methods usually applies to a given printer type.
Print wheels (or print balls) and font cartridges, from the point of view of the LP print service, are similar, because someone must intervene and mount the hardware on the printer, when needed. Character sets that require you to
physically mount a wheel or cartridge are referred to as hardware character sets. Character sets that do not require hardware mounting, that come preprogrammed with the printer, and can be selected by a print request, are referred to as software character sets.
When you set up a non-PostScript printer, you need to tell the LP print service which print wheels or selectable character sets are available to users. When users make print requests, the lp -S command lets them specify a print wheel or selectable character set to use for the print job. The user does not have to know which type of character set applies; he or she just refers to the font style by the name you have defined.

Selectable Character Sets

The selectable character sets supported by a printer are listed in the terminfo entry for that printer. For example, the entry for the ln03 printer is /usr/share/lib/terminfo/l/ln03. You can find the names of selectable character sets for any printer type in the terminfo database by using the tput command. The syntax for the tput command is:

  tput -T printer-type csnm n  

The csnm option is an abbreviation for character set number. The number starts with 0, which is always the default character set number after the printer is initialized. You can repeat the command, using 1, 2, 3, and so on in place of the 0, to display the names of the other character sets. For each selectable character set, a terminfo name (for example, usascii, english, finnish, and so forth) is returned.
In general, the terminfo character set names should match closely the character set names used in the manufacturer's documentation for the printer. Because some manufacturers do not use the same character set names, the terminfo names may differ from one printer type to the next.
You do not have to register the selectable character set names with the LP print service. However, you can give them more meaningful names or aliases.

Note - If you do not specify the selectable character sets that can be used with a printer, the LP print service assumes that a printer can accept any character set name (cs0, cs1, cs2, etc.) or the terminfo name known for the printer.

Users can employ the lpstat -p -l command to display the names of the selectable character sets that you have defined for each printer on a print server.

Note - Character sets for PostScript printers are not listed when you use the lpstat -p -l command because the PostScript fonts are controlled by PostScript filters, not by entries in the terminfo database. See "Installing and Maintaining PostScript Fonts" on page 132 for information about how to administer PostScript fonts.

Hardware-Mounted Character Sets

Another method to obtain alternative character sets is to use removable daisy wheels (print balls) or font cartridges that are physically mounted on a printer.
To administer hardware-mounted character sets, you inform the LP print service of the names you want to use for the available print wheels, and how you want to be alerted when a printer needs a different print wheel. Then, when a user requests a particular character set, using the lp -S command, the scheduler sends an alert to mount the print wheel, and the print request is placed in the print queue. When you mount the correct print wheel, and tell the LP print service that the print wheel is mounted, the job is printed.
If you do not specify multiple print wheels or cartridges for a printer, the LP print service assumes the printer has a single, fixed print wheel or cartridge, and users may not ask for a special print wheel or cartridge when using the printer.
Unlike selectable character sets, the names you use for print wheels or cartridges are not tied to entries in the terminfo database. Print wheel or cartridge names are used just to communicate with the LP print service and its users.
The names you choose for print wheels or cartridges, however, should have meaning to the users; the names should refer to font styles. In addition, the names should be the same across printers that have similar print wheels or
cartridges, or selectable character sets. That way, the user can ask for a font style (character set), without regard to which printer, or even whether a print wheel or cartridges, or selectable character set will be used.
Of course, you and the printer users should agree on the meanings of print wheel or cartridge names. Otherwise, what a user asks for, and what you mount, may not be the same character set.

Alerts for Mounting Print Wheels or Cartridges

You request alerts for mounting print wheels or cartridges in the same way you request other alerts from the LP print service. See "Setting Printer Fault Alerts" on page 156 for general information about alerts.

Setting Up and Administering Print Filters

Print filters are programs that convert the content type of a file to a content type that is acceptable to a destination printer.
The LP print service uses filters to:
  • Convert a file from one data format to another so that it can be printed properly on a specific type of printer
  • Handle the special modes of printing, like two-sided printing, landscape printing, or draft- or letter-quality printing
  • Detect printer faults and notify the LP print service of them so that the print service can alert users and system administrators
Not every print filter can perform all these tasks. Because each task is printer-specific, they can be implemented separately.
The LP print service provides the PostScript filters listed in Table A-1 on page 279. The filter programs are located in the /usr/lib/lp/postscript directory. Usually, for PostScript printing, you do not need to do anything beyond installing them when setting up a print server. The Printer Manager automatically enables the supplied filters.
If, however, you administer other printers, you may need to administer print filters for them.

Creating a Print Filter

Creating a new print filter is not easy, and usually requires extensive programming experience. Filters contain input types, output types, and complex options that provide a language to process command-line arguments within the filter.

Adding, Changing, Removing, and Restoring Print Filters

Print filters are added, changed, or removed on both the print server and the print clients.
You use the lpfilter command to manage the list of available filters. System information about filters is stored in the /etc/lp/filter.table file. The lpfilter command gets the information about filters to write to the table from filter descriptor files. The filter descriptor files supplied (PostScript only) are located in the /etc/lp/fd directory. The actual filter programs are located under /usr/lib/lp.
The LP print service imposes no fixed limit on the number of print filters you can define. You may remove filters that are no longer used to avoid extra processing by the LP print service, which must examine all filters to find one that works for a specific print request. If in doubt, do not remove a filter.
As you add, change, or delete filters, you may overwrite or remove some of the original filters provided by the LP print service. You can restore the original set of filters, if necessary, and remove any filters you have added.

Setting Up and Administering Forms

A form is a sheet of paper on which information is printed in a predetermined format. Unlike plain paper stock, forms usually have text or graphics preprinted on them. Common examples of forms are company letterhead, invoices, blank checks, receipts, and labels.
The term form includes two senses: the physical medium (the paper) and the software information that defines a form to the LP print service.
The LP print service allows you to control the use of forms. This chapter describes how to add, change, remove, and mount forms, and how to control access to forms.

Adding, Changing, or Removing Forms

When you add a form, you tell the LP print service to include the form in its list of available forms. You also have to supply the information required to describe or define the form. Although you can enter such definitions when you add the form, it helps to create the definitions first and save them in files. You can then change the form definition by editing the file. See "How to Provide a New Form" on page 353 for information about how to create form definitions.

Note - No form definitions are supplied with the LP print service.

Changing a form is done by re-adding the form with a different definition.
The LP print service imposes no limit on the number of forms you can define. However, you should remove forms that are no longer appropriate. Obsolete forms may result in unnecessary processing by the print service.

Mounting Forms

To mount a form, you must load the paper into the printer, and notify the LP print service that the form is mounted. If you use one printer for different types of printing, including forms, you should disable the printer before you load the paper and mount the form. Then re-enable the printer when the form is ready; otherwise, the LP print service will continue to print files that do not need the form on the printer.
When you mount a form, make sure that it is aligned properly. If an alignment pattern has been defined for the form, you can ask that it be repeatedly printed after you have mounted the form, and if needed, until you have adjusted the printer so that the alignment is correct.
When you want to change or discontinue using a form on a printer, you have to notify the LP print service by unmounting the form.

Defining Alerts for Mounting Forms

You request alerts for mounting forms in the same way you request other alerts from the LP print service. See "Setting Printer Fault Alerts" on page 156 for general information about alerts.

Checking Forms

When you have defined a form for the LP print service, you can check it with either of two commands, depending on the type of information you want to check.
  • Use the lpforms command to show the attributes of the form. You can also redirect the output of the command into a file to save it for future reference.
  • Use the lpstat command to display the current status of the form. To protect potentially sensitive content, the alignment pattern is not shown.
If you are not sure about the name of an existing form, you can list the contents of the /etc/lp/forms directory to see the names of the forms there.

Controlling Access to Forms

You can control which printers and users have access to some or all of the forms available on the network. For example, you may want only the people in the payroll or accounts payable department to be able to print check forms. In addition, you may want the check forms to be available only on certain printers.
You restrict user access to forms by creating allow and deny lists. See "Creating allow and deny Lists" on page 160 for a general description of allow and deny lists.
If you want users on your system to have access to forms on a print server, include all users in the allow list for both the client system and in the allow list for the print server. If, on the other hand, a user is denied permission to use forms on a print server, you do not need to include that user in a deny list on the print client system.
It is a good idea to make the deny lists for print servers and clients match.

Installing and Maintaining PostScript Fonts

If you have a laser printer, you may need to install and maintain PostScript fonts. You may have to decide where PostScript fonts are installed and how they are managed. For many printers, the fonts are set up as part of the printer installation process.
PostScript fonts are stored in outline form, either on the printer or on a system that communicates with the 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:
  • Printer-resident fonts are stored permanently on a printer. These fonts are installed in read-only memory (ROM) on the printer by the manufacturer. If the printer has a disk, you may need to install fonts on that disk. Most PostScript printers are shipped with 35 standard fonts.
  • A permanently downloaded font is transmitted to a printer with a PostScript exitserver program. A permanently downloaded font remains in printer memory until the printer is turned off. Memory allocated to a downloaded font reduces the memory available on the server for PostScript print requests. Use of an exitserver program requires the printer system password and may be reserved for the printer administrator. You should permanently download fonts when most print requests serviced by that printer use the font.
  • Fonts that are used infrequently or for special purposes can be stored on a user's system. The user can specify these fonts when submitting the print request. The fonts are appended to the print request and transmitted to the printer. When the print request is processed, the space allocated for the font is freed for other print requests.
  • Host-resident fonts are stored on a system shared by many users. The system that stores the fonts may be a print server or a print client. Each user may request fonts in the document to be printed. This method is useful when there are numerous available fonts, or when these fonts are not used by all print requests. If the fonts will be used only on printers attached to a server, they should be stored on the print server. If the fonts are to be used by users on one system, who may send jobs to multiple printers on a network, they should be stored on the user's system.
The LP print service provides a special download filter to manage host-resident fonts. It also supplies troff width tables for the 35 standard PostScript fonts which reside on many PostScript printers, for use by the troff program.

Managing 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. When a printer is installed, you should add the list of printer-resident fonts to the font list for that printer. By identifying printer-resident fonts, you prevent fonts from being transmitted unnecessarily across a network. Each printer has its own list of resident fonts, which is contained in the file:

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

When the printer is attached to a print server, make sure the list in the residentfonts file includes fonts that are on the print server and which are available for downloading to the printer.
You must edit the files containing the list of printer-resident fonts by using a text editor like vi.

Downloading Host-Resident Fonts

When a PostScript document contains a request for fonts not loaded on the printer, the download filter manages this request. The download filter uses PostScript document structuring conventions to determine which fonts to download.
LP print filters are either fast or slow. A fast filter quickly prepares a file for printing, and it must have access to the printer while the filter is processing. A slow filter takes longer to convert a file, and it does not need to access the printer while the filter is processing. An example of a slow filter is ASCII to PostScript.
The download filter is a fast filter; it downloads fonts automatically if the fonts are on the print server. The download filter may also be used to send fonts to a print server. To do this, you may create a new filter table entry which calls the download filter as a slow filter through the -y option to the lp command. Alternatively, you may force selection of this filter by changing the input type. For information about defining print filters, see "Defining a Print Filter" on page 336.
The download filter performs five tasks:
  1. It searches the PostScript document to determine which fonts are requested. These requests are documented with the following PostScript structuring comments: %%DocumentFonts: font1 font2 ... in the header comments.

  2. It searches the list of printer-resident fonts to determine if the requested font must be downloaded.

  3. If the font is not resident on the printer, the download filter searches the host-resident font directory (by getting the appropriate file name from the map table) to determine if the requested font is available.

  4. If the font is available, the filter takes the file for that font and appends it to the file to be printed.

  5. It sends the font definition file and the source file (the file to be printed) to the PostScript printer.

Installing and Maintaining Host-Resident Fonts

Some fonts reside on the host system and are transmitted to the printer as needed for particular print requests. As the administrator, you make PostScript fonts available to all users on a system. To do so, you must know how and where to install these fonts. Because fonts are requested by name and stored in files, the LP 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 the map and the font list must be updated when you install host-resident fonts.
The fonts available for use with PostScript printers are stored in directories you create called /usr/share/lib/hostfontdir/typeface/font, where typeface is replaced by a name like palatino or helvetica, and font is replaced by a name like bold or italic.

Managing Character Sets, Filters, Forms, and Fonts

This section provides step-by-step instructions for performing tasks related to setting up and administering character sets, print filters, forms, and fonts. For many tasks, you will find an example of user input and system output after the instructions.

· How to Set Up Hardware-Mounted or Selectable Character Sets

To set up print wheels or font cartridges: 1. On the print server, become root or lp.
  1. Type lpadmin -p printer-name

    -S hardware-charset-name1,hardware-charset-name2,... and press Return. This command defines which print wheels or cartridges can be used with the specified printer. The named print wheels or cartridges are registered with the LP print service. Do not put spaces in the comma-separated list. Define names that are meaningful to users, and inform users of the names.

  2. Specify how you want to be alerted to mount the print wheel.

    See "How to Mount, Unmount, and Set Alerts for Hard Character Sets" on page 138.

  3. On each print client, become root or lp.

5. Type lpadmin -p printer-name -S

hardware-charset-name1,hardware-charset-name2... and press Return.
This command defines which print wheels or cartridges can be used with the specified printer. The named print wheels or cartridges are registered with the LP print service. Do not put spaces in the comma-separated list. Define names that are meaningful to users, and inform users of the names.
To set up selectable character sets: 1. On the print server, become root or lp.
  1. Type tput -T printer-type csnm n and press Return. The name of the character set as known to the terminfo database is displayed. The printer type must match an entry in the terminfo database. See "Printer Entries in the terminfo Database" on page 84.

  1. Repeat the tput command, typing 0 as the number you substitute for n and increasing the numbers by one (0, 1, 2, 3, 4, 5 and so on) until no more character sets are displayed.

    You must determine which character sets are available in the terminfo database before you can name the character sets to the LP print service.


  # tput -T ln03 csnm 0  
  usascii# tput -T ln03 csnm 1  
  english# tput -T ln03 csnm 2  
  finnish# tput -T ln03 csnm 3  
  japanese# tput -T ln03 csnm 4  
  norwegian# tput -T ln03 csnm 5  
  swedish# tput -T ln03 csnm 6  
  germanic# tput -T ln03 csnm 7  
  french# tput -T ln03 csnm 8  
  canadian_french# tput -T ln03 csnm 9  
  italian# tput -T ln03 csnm 10  
  spanish# tput -T ln03 csnm 11  
  line# tput -T ln03 csnm 12  
  security# tput -T ln03 csnm 13  
  ebcdic# tput -T ln03 csnm 14  
  apl# tput -T ln03 csnm 15  
  mosaic# tput -T ln03 csnm 16  
  #  

  1. (Recommended) On both the print server and print clients, type lpadmin -p printer-name\

    -S charset-namen=aliasn,charset-namem=aliasm... and press Return. The named character sets are given the specified aliases. Do not put spaces in the comma-separated list. Character sets not given aliases in this command must be referenced by their terminfo names, or numbers with the cs prefix (for example, cs1, cs2). Aliases can be used in addition to the terminfo names and cs numbers.


  # lpadmin -p slw2 -S usascii=text,line=printouts  


Note - You do not need to perform this step to provide a list of aliases for the selectable character sets if the terminfo names are adequate.

· How to Mount, Unmount, and Set Alerts for Hard Character Sets

You must be root or lp to perform the following procedures.
To mount a print wheel or cartridge: 1. Put the print wheel or cartridge on the printer.
  1. Type lpadmin -p printer-name -M -S hardware-charset-name and press Return.

    Notifies the LP print service that the print wheel or cartridge is mounted. The mounted print wheel remains active until it is unmounted or until a new print wheel is mounted.

    For example, to mount the print wheel named pica on slw2:


  # lpadmin -p slw2 -M -S pica  

To unmount a print wheel or cartridge: * Type lpadmin -p printer-name -M -S none and press Return. No print wheels or cartridges are mounted. You unmount print wheels or cartridges by mounting "none" of the character sets. For example:

  # lpadmin -p slw2 -M -S none  

To specify alerts to mount a print wheel or cartridge: * Type lpadmin -S hardware-charset-name -A type\ -Q requests -W minutes and press Return. Use Table 5-1 to choose the type of alert. If you do not specify what type of alert to give for print wheels, the default none is used.
Table 5-1
TypeDescription
'mail [username]'Send the alert message by email to the administrator (root or lp, depending on who ran lpadmin), or the specified user.
'write [username]'Send the alert message to the system console window of the current user or the specified user.
'command'Run the command file for each alert. The environment variables and current directory are saved and restored when the file is executed.
noneDo not send any alert for the specified print wheel or cartridge (a useful option for the default or a permanently hardware-mounted character set).
For a specified print wheel or cartridge, this command asks for notification, according to the desired alert type, when the print queue contains a specific number of requests (-Q) needing that print wheel or cartridge. This command also specifies the number of minutes (-W) between alert reminders. You do not specify the alert message. It is a predefined message that says to mount the named print wheel or cartridge, and names one or more printers that have been set up to use such a print wheel or cartridge.
To stop the alerts for the current print wheel or cartridge: * Type lpadmin -S hardware-charset-name -A quiet and press Return. When you start receiving repeated alerts, this command suppresses the alerts until the print wheel or cartridge has been mounted and unmounted again, and the number of requests exceeds the -Q threshold.

Note - If hardware-charset-name is all in any of the previous commands, the alerting condition applies to all print wheels or cartridges for which an alert already has been defined. If you do not define an alert method for a print wheel or cartridge, you will not receive an alert to mount it. If you do define a method without the -W option, you will be alerted once for each occasion.

Examples of Setting Mount Alerts for Print Wheels or Cartridges

To receive email alerts every five minutes for a print wheel named elite when there are 10 requests for elite in the queue:

  # lpadmin -S elite -A mail -Q 10 -W 5  

To receive email alerts every minute for a cartridge named finnis when there are five requests for finnish in the queue:

  # lpadmin -S finnish -A mail -Q 5 -W 1  

To receive message alerts every 10 minutes to the console window for a print wheel named elite, when there are five requests for elite in the queue:

  # lpadmin -S elite -A write -Q 5 -W 10  

To receive no alerts for a print wheel named elite:

  # lpadmin -S elite -A none  

· How to Add, Change, Remove, or Restore Print Filters

You must be root or lp to perform the following procedures, which apply to either the print server or the print client.
To add a print filter using a definition from a file: * To use a file, type lpfilter -f filter-name -F filename.fd and press Return.
The print filter definition from the file named is added to the /etc/lp/filter.table file using the filter name you specify.

  # lpfilter -f daisytroff -F /etc/lp/fd/daisytroff.fd  

To add a print filter from the command line: * Type lpfilter -f filter-name - filter-definition and press Control-d. The filter definition you type is added to the /etc/lp/filter.table file using the filter name you specify. The print filter definition has the following format:

  Command: command-pathname [options]  
  Input types: input-type-list  
  Output types: output-type-list  
  Printer types: printer-type-list  
  Printers: printer-list  
  Filter type: fast or slow  
  Options: template-list  

To change a print filter: * Follow the steps in the previous procedure for adding a filter, except include only the changed items.
The print filter definition in /etc/lp/filter.table is changed. You need to provide information only for those items that must be changed; items for which you do not specify new information remain the same.
To remove a print filter: * Type lpfilter -f filter-name -x and press Return. The filter entry is removed from the /etc/lp/filter.table file. You can remove a print filter from a print client, and not remove it from the print server, so other print clients can still use the print filter.

  # lpfilter -f daisytroff -x  

To restore the LP print service to its original set of default print filters: * To restore all filters, type lpfilter -f all -i and press Return. To restore a specific filter, type lpfilter -f filter-name -i and press Return.

· How to View Print Filter Definitions

You must be either root or lp to perform the following procedures, which apply to either the print server or the print client.
To view a print filter definition: * Type lpfilter -f filter-name -l and press Return. The definition of the print filter is displayed. Use all for filter-name to see the definitions of all installed print filters.

  # lpfilter -f postdaisy -l  
  Input types: daisy  
  Output types: postscript  
  Printer types: any  
  Printers: any  
  Filter type: slow  
  Command: /usr/lib/lp/postscript/postdaisy  
  Options: PAGES * = -o*  
  Options: COPIES * = -c*  
  Options: MODES group = -n2  
  Options: MODES group\=\([2-9]\) = -n\1  
  Options: MODES portrait = -pp  
  Options: MODES landscape = -pl  
  Options: MODES x\=\(\-*[\.0-9]*\) = -x\1  
  Options: MODES y\=\(\-*[\.0-9]*\) = -y\1  
  Options: MODES magnify\=\([\.0-9]*\) = -m\1  

To redirect the definition of the print filter to a file: * Type lpfilter -f filter-name -l > filename and press Return. The output from the command is saved in the file name that you specify. You may want to save the output in a file that you can use later to redefine the print filter if you inadvertently remove the filter from the LP print service.
To check which filters are installed: * Type lpfilter -f all -l | grep Filter and press Return. This command gives you a list of all the filters and their types installed in the /etc/lp/filter.table file.

  # lpfilter -f all -l | grep Filter  
  (Filter "download")  
  Filter type: fast  
  (Filter "postio")  
  Filter type: fast  
  (Filter "postior")  
  Filter type: fast  
  (Filter "postreverse")  
  Filter type: slow  
  (Filter "postdaisy")  
  Filter type: slow  

· How to Add, Change, or Remove a Form

You must be either root or lp to perform the following procedures, which apply to either the print server or the print client.
To add a form using a definition from a file: * Type lpforms -f form-name -F filename and press Return. The form definition from the file named is added to the /etc/lp/forms/form-name directory.

  terra# lpforms -f medical -F /etc/lp/forms/medical.fmd  

To add a form from the command line: * Type lpforms -f form-name - form-definition and press Control-d. The form definition is added to the /etc/lp/forms/form-name directory. The form definition has the following format:

  Page length: scaled number  
  Page width: scaled number  
  Number of pages: integer  
  Line pitch: scaled number  
  Character pitch: scaled number  
  Character set choice: character-set-name [,mandatory]  
  Ribbon color: ribbon-color  
  Comment:  
  informal notes about the form  
  Alignment pattern: [content-type] alignment pattern  


Note - Before the form can be used, one or more printers must be granted access to the form. See "How to Allow or Deny Use of Forms on a Printer" on page 150.

To change a form: * Follow the steps in the previous procedure for adding a form, except include only the changed items.
You need to provide information only for those items that must be changed; items for which you do not specify new information remain the same.
To remove a form: * Type lpforms -f form-name -x and press Return. The /etc/lp/forms/form-name directory is removed from the system. You can remove a form from a print client, and not remove it from the print server, so other print clients can still use the form.

  # lpforms -f medical -x  

· How to Mount, Unmount, and Specify Alerts for Forms

You must be either root or lp to perform the following procedures, which apply only to the print server.
To mount a form: 1. Type disable printer-name and press Return. This disables the printer so new print jobs (which may not be appropriate for the form) are not allowed to be queued to the printer.
  1. Load the form paper into the printer.

  2. Mount the form by typing

    lpadmin -p printer-name -M -f form-name -a -o filebreak and pressing Return.

    When you mount a form that has an alignment pattern defined for it, and you include the -a -o filebreak option following the form name, you are instructed to press Return to print a copy of the alignment pattern. After the pattern is printed, you can adjust the printer and press Return again. If the form does not have an alignment pattern, or you do not want to use it, omit the -a -o filebreak from the command.

  3. Type enable printer-name and press Return. Now the printer is ready to print on the newly mounted form.


  terra# disable luna  
  printer "luna" disabled  
  terra# lpadmin -p luna -M f medical -a -o filebreak  
  terra# enable luna  
  printer "luna" enabled  

To unmount a form: 1. Type disable -p printer-name and press Return. The printer is disabled.
  1. Type lpadmin -p printer-name -M -f none and press Return. The form is unmounted from the LP print service.

  1. Remove the form paper from the printer.

    After you remove the form paper, add the appropriate paper for the next print job.

  2. Type enable -p printer-name and press Return. The printer is enabled and ready to print.


  terra# disable luna  
  printer "luna" disabled  
  terra# lpadmin -p luna -M f none  
  terra# enable luna  
  printer "luna" enabled  

To specify alerts for mounting forms: * Type lpforms -f form-name -A 'type' -Q requests -W minutes and press Return.
Use Table 5-2 to choose the type of alert you want to receive when print requests require a form to be mounted. If you do not define an alert, you will not receive any.
Table 5-2
TypeDescription
'mail [username]'Send the alert message by email to the administrator (root or lp, depending on who ran lpforms), or to the specified user.
'write [username]'Send the alert message written to the system console window of the current user, or to the specified user.
'command'Run the command file for each alert. The environment variables and current directory are saved and restored when the file is executed.
noneDo not send any alert for the specified form (a useful option for the default form or one that is mounted permanently).
For a specified form, the lpforms command asks for notification, according to the desired alert type, when the print queue contains a specific number of requests (-Q) needing that form. This command specifies the number of minutes (-W) between alerts. You do not specify the alert message. It is a predefined message that says to mount the named form, and names one or more printers that have been set up to use such a form.
To stop alerts for the current form: * Type lpforms -f form-name -A quiet and press Return. When you start receiving repeated alerts, this suppresses them for the specified form until the form has been mounted and unmounted again, and the number of requests exceeds the -Q threshold.

Note - If form-name is all in any of the previous commands, the alerting condition applies to all forms for which an alert already has been defined. If you do not define an alert method for a form, you will not receive an alert to mount it. If you define a method without the -W option, you will be alerted once for each occasion.

Examples of Specifying Alerts for Mounting Forms

To receive email alerts on the print server every five minutes for a form named letterhead, when there are 10 requests for letterhead in the queue:

  # lpforms -f letterhead -A mail -Q 10 -W 5  

To receive message alerts to the console window of the print server every 10 minutes when there are 5 requests for letterhead in the queue:

  # lpforms -f letterhead -A write -Q 5 -W 10  

To receive no alerts for a form named letterhead:

  # lpforms -f letterhead -A none  

· How to Obtain Information About Forms

The following procedures apply to either the print server or the print client.
To review the definition of a form: 1. Become root or lp.
  1. Type lpforms -f form-names -l and press Return. The definition of the forms is displayed. If you specify multiple forms, separate names with commas, or use spaces and enclose the list in double quotation marks. You can use all instead of form-names to review all forms.


  # lpforms -f medical -l  
  Page length: 62  
  Page width: 72  
  Number of pages: 2  
  Line pitch: 6  
  Character pitch: 12  
  Character set choice: pica  
  Ribbon color: black  
  Comment:  
  Prudential medical claim form  

To redirect the definition of the form to a file: 1. Become root or lp.
  1. Type lpforms -f form-name -l > filename and press Return. The output from the command is saved in the file name that you specify. This is useful for saving the form definition, which you could use to change the definition or restore it, if it gets removed unintentionally.

To show the current status of forms: * Type lpstat -f form-names and press Return. The status of the forms is displayed. If you specify multiple forms, separate names with commas, or use spaces and enclose the list in quotation marks. You can use all instead of form-names to review all forms.

  # lpstat -f medical,payroll  
  form medical is available to you  
  form payroll is available to you  

To show a form's current status and definition: * Type lpstat -f form-name -l and press Return. The definition of the form is displayed. If you specify multiple forms, separate names with commas, or use spaces and enclose the list in quotation marks. You can use all instead of form-name to review all forms.

  # lpstat -f medical -l  
  form medical is available to you  
          Page length: 62  
          Page width: 72  
          Number of pages: 2  
          Line pitch: 6  
          Character pitch: 12  
          Character set choice: pica  
          Ribbon color: black  
          Comment:  
          Prudential medical claim form  

· How to Allow or Deny User Access to Forms

You must be either root or lp to perform the following procedures, which apply to both the print server or the print client.
To allow users access to forms: * Type lpforms -f form-name -u allow:user-list and press Return. Separate user names with commas but no spaces. Or, you can use spaces to separate names, enclosing the word allow: and the names in quotation marks.

  # lpforms -f check -u allow:ignatz,ziggy  

To deny users access to forms: * Type lpforms -f form-name -u deny:user-list and press Return. Separate user names with commas but no spaces. If you use spaces to separate names, enclose the word deny: and the names in quotation marks.

  # lpforms -f dental -u deny:jones,smith  

To allow all users access to forms: * Type lpforms -f form-name -u allow:all and press Return.

  # lpforms -f check -u allow:all  

To deny all users access to forms: * Type lpforms -f form-name -u deny:all and press Return.

  # lpforms -f check -u deny:all  

· How to Allow or Deny Use of Forms on a Printer

You must be either root or lp to perform the following procedures, which apply to both the print server and print clients.
To allow a printer to access forms: * Type lpadmin -p printer-name -f allow:form-list and press Return. The printer now has access to the specified forms. Separate form names with commas but no spaces. Or, you can use spaces to separate names, enclosing the word allow: and the list of forms in quotation marks. Replace form list with all to allow access to all forms.

  # lpadmin -p luna -f allow:medical,dental,check  

To deny a printer access to forms: * Type lpadmin -p printer-name -f deny:form-list and press Return. Separate form names with commas but no spaces. Or, you can use spaces to separate names, enclosing the word deny: and the list of forms in quotation marks. Replace form-list with all to deny access to all forms.

  terra# lpadmin -p luna -f deny:medical,dental,payroll  


Note - If you do not use allow or deny options, the LP print service denies the use of all forms. You can, however, mount any form, even if it is denied, making it available for use.

· How to Install Downloaded and Host-Resident PostScript Fonts

The following procedures apply to both the print server and print clients.
To install downloaded fonts: 1. Type cd /etc/lp/printers/printer-name and press Return. This accesses the directory that contains the configuration information for the printer.
  1. Edit the file residentfonts, using a text editor like vi. The file may not exist, if this is the first time you are adding permanently downloaded fonts.

  2. List all printer-resident fonts and fonts to be permanently downloaded.

To install host-resident PostScript fonts, on the server: 1. Become root or lp.
  1. (If necessary) Create the hostfontdir directory by typing cd /usr/share/lib;mkdir hostfontdir; chmod 775 hostfontdir and pressing Return.

  2. (If necessary) Type mkdir typeface and press Return. Create a directory for a new typeface, if one does not exist already.

  1. Type cp filename /usr/share/lib/hostfontdir/typeface/font and press Return.

    Copy the font file to the appropriate directory.

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

    a. Type cd /usr/share/lib/hostfontdir and press Return. b. Edit the map file using a text editor like vi.

    c. Add a one-line entry for each font you want to add to the table, putting the font name first, followed by a space, followed by the name of the file (copied in step 4) where the font resides. For example:


  Palatino-Bold /usr/share/lib/hostfontdir/palatino/bold  

d. Save the file.
For example, once the example entry exists in the map table on the appropriate system, users will be able to apply the Palatino Bold font in their print jobs. When they submit a print request containing this font, the LP print service appends a copy of the file /usr/share/lib/hostfontdir/palatino/bold to that file before sending it to the printer.
  1. If you are using troff, you must create new width tables for this font in the standard troff font directory.