This chapter provides overview information and procedures for administering character sets, filters, forms, and fonts on a system with printers that have been configured by using the LP print service or with Solaris Print Manager.
This is a list of the information that is in this chapter:
Task |
Description |
For Instructions |
---|---|---|
Define a print wheel or font cartridge. |
Define a print wheel or font cartridge that can be used with a printer. |
How to Set an Alert to Mount a Print Wheel or Font Cartridge |
Unmount and mount a print wheel or font cartridge. |
Delete a current print wheel or font cartridge from the print server's configuration file. Adds a new print wheel or font cartridge to the print server's configuration file. | |
Set up alerts to mount a print wheel or font cartridge. |
Set up email alerts for print requests. |
How to Set an Alert to Mount a Print Wheel or Font Cartridge |
Set up an alias for a selectable character set. |
Set up aliases when terminfo names for the selectable character sets are inadequate. |
Printers differ in the method that they use to print text in various font styles. For example, PostScript printers treat text as graphics. These printers can generate text in different fonts. They can also 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. These printers use either print wheels, font cartridges, or preprogrammed selectable character sets. Usually, only one printing method applies to a given printer type.
From the perspective of the LP print service, print wheels and font cartridges are similar. In both cases, someone must intervene and mount the hardware on the printer, when needed. Character sets that require you to physically mount a print wheel or font cartridge are referred to as hardware character sets. Character sets that do not require hardware mounting, come preprogrammed with the printer. These character sets can be selected by a print request. They 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 submit print requests, the lp -S command enables them to specify a print wheel or selectable character set to use for the print job. Users do not have to know which type of character set applies. They just refer to the font style by the name you have defined. For example, you can define a print wheel as gothic. To request the gothic print wheel, the user would use the following command:
% lp -S gothic filename |
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 as follows:
tput -T printer-type csn |
The csn 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. To display the names of the other character sets, you can repeat the command by using -1, -2, -3, and so on, in place of the -0. 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 closely match the character set names that are used in the manufacturer's documentation for the printer. Because all manufacturers do not use the same character set names, the terminfo character set names can differ from one printer type to the next printer type.
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.
If you do not specify the selectable character sets that can be used with a printer, the LP print service assumes that the printer can accept any character set name, such as cs0, cs1, or cs2, or the terminfo name known for the printer.
Character sets for PostScript printers are not listed when you use the lpstat -p -l command. The PostScript fonts are controlled by PostScript filters, not by entries in the terminfo database. For information about how to administer PostScript fonts, see Administering Fonts.
Users can use 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.
Another method to obtain alternative character sets is to use removable print wheels or font cartridges that you physically attach, or mount, in a printer.
To administer hardware-mounted character sets, you inform the LP print service of the following:
The names you want to use for the available print wheels
How you want to be alerted when a printer needs a different print wheel
Then, when a user requests a particular character set by using the lp -S command, the print scheduler sends an alert to mount the print wheel. In addition, 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. For more information, see How to Unmount and Mount a Print Wheel or Font Cartridge.
If you do not specify multiple print wheels or font cartridges for a printer, the LP print service assumes that the printer has a single, fixed print wheel or font cartridge. As such, users cannot specify a special print wheel or font cartridge when using that printer.
Unlike selectable character sets, the names you use for print wheels or font cartridges are not tied to entries in the terminfo database. Print wheel names or font cartridge names are used only for the purpose of communicating with the LP print service and its users.
However, the names you choose for print wheels or font cartridges 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, font cartridges, or selectable character sets. That way, users can specify a font style (character set), without regard to which printer will be used, or whether a print wheel, font cartridges, or a selectable character set will be used.
You and the printer users should agree on the meanings of print wheel names or font cartridge names. Otherwise, what a user asks for and what you mount might not be the same character set.
The procedure for tracking print wheels is similar to the procedure for tracking forms. Some printers, usually letter-quality printers, have removable print heads that provide a particular font or character set. Removable print heads include print wheels and print cartridges. A user can request a named character set. If that character set is not available, the LP print service notifies root of the request. The job is stored in the print queue until the print wheel is changed.
You request alerts for mounting print wheels or font cartridges in the same way that you request other alerts from the LP print service. For general information about alerts, see Setting Up Printer Fault Recovery by Using LP Print Commands.
These procedure shows how to define a print wheel or font cartridge that can be used with the printer.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Define a print wheel or font cartridge.
# print-server lpadmin -p printer-name -S hard-charset1[,hard-charset2...] |
Specifies the name of the printer for which you are defining a print wheel or font cartridge.
Specifies the hardware character set name of the print wheel or font cartridge.
You can specify multiple hardware character sets with this command. Use commas or spaces to separate character set names. If you use spaces, enclose the list of character set names in quotation marks.
Define names that are meaningful to users. Inform the users of these names.
The print wheel or font cartridge definition is specified in the print server's /etc/lp/printers/printer-name/configuration file.
On a print client of the print server, log in as superuser, lp, or assume an equivalent role.
Define the same print wheel or font cartridge for the print client.
# print-client lpadmin -p printer-name -S hard-charset1, hard-charset2... |
In this command, the variables are the same as the variables in Step 2.
The print wheel or font cartridge definition is added to the print client's /etc/lp/printers/printer-name/configuration file.
Repeat Step 3 and Step 4 for each print client that might need to use the print wheel or font cartridge.
Verify that the print wheel or font cartridge is defined.
You should see the name of the character set and the notation (mounted).
# lpstat -p printer-name -l |
The following example shows how to define the pica print wheel on the printer luna. The print client is named asteroid.
asteroid# lpadmin -p luna -S pica |
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Unmount the print wheel or font cartridge that is mounted in the printer.
# lpadmin -p printer-name -M -S none |
Specifies the printer on which you are unmounting a print wheel or font cartridge.
Indicates that you want to unmount the current print wheel or font cartridge.
For more information, see the lpadmin(1M) man page.
The current print wheel or font cartridge is deleted from the print server's /etc/lp/printers/printer-name/configuration file.
Remove the print wheel or font cartridge from the printer.
Put the new print wheel or font cartridge in the printer.
Mount the new print wheel or font cartridge.
# lpadmin -p printer-name -M -S hard-charset... |
Specifies the printer on which you are mounting a print wheel or font cartridge.
Specifies the hardware character set name of the print wheel or font cartridge you want to mount.
The print wheel or font cartridge is added to the print server's /etc/lp/printers/printer-name/configuration file. The mounted print wheel or font cartridge remains active until it is unmounted or until a new print wheel or font cartridge is mounted.
Check the information under the Print wheels or Character set heading in the output of the following command.
You should see the name of the print wheel or character set and the notation (mounted).
# lpstat -p printer-name -l |
The following example shows how to unmount the current print wheel on the printer luna and mount the pica print wheel.
# lpadmin -p luna -M -S none # lpadmin -p luna -M -S pica |
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Set an alert to mount a print wheel or font cartridge.
# lpadmin -S hard-charset -A alert [-Q requests] [-W minutes] |
Specifies the hardware character set name of the print wheel or font cartridge for which you want to set an alert.
Specifies what kind of alert will occur when a print wheel or font cartridge is requested. For detailed information about the valid values for alert, see Table 6–5. Some valid values are mail, write, and quiet.
If you specify mail or write, a predefined alert message says to mount the specified print wheel or font cartridge. The message includes the names of one or more printers that have been set up to use such a print wheel or font cartridge.
Specifies the number of print requests that require the print wheel or font cartridge that must be in the queue before an alert occurs. If you don't specify this option, only one print request in the queue triggers an alert.
Specifies how often (in minutes) the alert occurs If you don't specify this option, the alert is sent one time.
For more information, see the lpadmin(1M) man page.
The alert is added to the print server's /etc/lp/pwheels/charset-name/alert.sh file.
Verify that the alert has been added for the print wheel or font cartridge by checking the output of the following command.
# lpadmin -S hard-charset -A list |
Alternately, if you have set a low number of print requests to trigger the alert, submit enough print requests to meet the minimum requirements. Ensure that you receive an alert to mount the print wheel or font cartridge.
The following example shows how to set email alerts to occur every 5 minutes for the elite print wheel when the print queue contains 10 print requests for the elite.
# lpadmin -S elite -A mail -Q 10 -W 5 |
The following example shows how to set email alerts to occur every minute for the finnish font cartridge when the print queue contains 5 print requests for the finnish.
# lpadmin -S finnish -A mail -Q 5 -W 1 |
The following example shows how to set up no alerts for the elite print wheel.
# lpadmin -S elite -A none |
You do not need to perform this procedure if the terminfo names for the selectable character sets are adequate. For more information on using the terminfo database, see Adding a terminfo Entry for an Unsupported Printer.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Display the names of the selectable character sets for the specified printer type.
# tput -T printer-type csn |
Specifies the printer type found in the terminfo database. For information on entries in the terminfo database, see Printer Type.
Specifies the number (0, 1, 2, 3, 4, 5, and so on) that represents a selectable character set for the specified printer type. The system displays the selectable character set name followed by the prompt symbol. For example, cs1 could cause the system to display english#.
For more information, see the tput(1) man page.
Set up an alias for a selectable character set.
# lpadmin -p printer-name -S select-charset1=alias1,select-charset2=alias2... |
Specifies the printer on which you are setting up aliases for selectable character sets.
Specifies the electable character set name. The name can be found in Step 2.
Is the alias for the specified selectable character set. This alias can be used in addition to the selectable character set name.
You can set up more than one alias with this command. Use commas or spaces to separate the aliases. If you use spaces, enclose the list of aliases in quotation marks.
The alias is added to the print server's /etc/lp/printers/printer-name/configuration file.
On a system that is a print client of the print server, log in as superuser, lp, or assume an equivalent role.
Set up an alias for the selectable character set.
# lpadmin -p printer-name -S select-charset1=alias1,select-charset2=alias2... |
In this command, the variables are the same as the variables in Step 3.
The alias is added to the print client's /etc/lp/printers/printer-name/configuration file.
Repeat Step 4 and Step 5 for each print client that might need to use the alias.
On the print server and print clients, verify that the selectable character set alias is listed in the output of the following command.
# lpstat -p printer-name -l |
Alternately, submit a print request that uses the alias for the selectable character set and check for output.
The following example shows how to display the names of selectable character sets for the usascii selectable character set on the printer luna. The printer luna is a ln03 printer type. This example also shows how to specify text as an alias for the usascii selectable character set.
# tput -T ln03 cs0 usascii# tput -T ln03 cs1 english# tput -T ln03 csn2 finnish# tput -T ln03 csn3 japanese# tput -T ln03 cs4 norwegian# # lpadmin -p luna -S usascii=text |
Task |
Description |
For Instructions |
---|---|---|
Create a new print filter. |
Create a new print filter for file types that the LP print service cannot interpret. | |
Add a print filter. |
Add information about print filters, which are programs that convert the content type of a file to a content type that is acceptable to the destination printer. | |
Delete a print filter. |
Delete information about print filters, which are programs that convert the content type of a file to a content type that is acceptable to the destination printer. | |
View information about a print filter. |
Delete information about print filters, which are programs that convert the content type of a file to a content type that is acceptable to the destination printer. |
A filter is used by the LP print service each time it has to print a type of file that the printer cannot interpret. Creating a new print filter is not easy, and it usually requires extensive experimentation.
The process of defining a new print filter consists of two steps:
Writing a print filter program
Creating a print filter definition
A print filter can be as simple or as complex as needed. Filters contain input types, output types, and complex options that provide a language to process command-line arguments within the filter.
If you have nonPostScript printers, you have to create and add print filters as required. First, you need to understand what print filters are and the requirements that must be met by a filter program.
The LP print service provides filter programs in the /usr/lib/lp/postscript directory. These filters cover most PostScript printing situations, where the destination printer requires the data to be in PostScript format. A print filter program must be a binary executable file.
There are two types of print filters: fast filters and slow filters.
Fast filters do not require much processing time to prepare a file for printing. They must have access to the printer when they run. To be capable of detecting printer faults, a print filter must be a fast filter. Any filter that uses the PRINTER keyword as a filter option must be installed as a fast filter.
Slow filters require a great deal of processing time to prepare a file for printing. They do not require access to the printer when they run. Slow filters are run in the background so they do not tie up the printer, allowing other files that do not need slow filtering to be printed.
The LP print service uses print filters to convert files from one content type to another content type. You can specify the accepted file content types for each printer. The user specifies the file content type when submitting a print request. Then, the LP print service finds a printer that can print files of that content type. Because many applications can generate files for various printers, this method is often sufficient. However, some applications can generate files that cannot be printed on any available printers.
Each time the LP print service receives a request to print a type of file that is in a format that cannot be accepted directly by a printer, the LP print service tries to match the content type of the print request with the content type of the available (or specified) printer. If there is a match, the file can be sent directly to the printer without filtering. If no match is found, or if the content type specifies that a filter be used, the LP print service tries to match the content type of the file with the input content type of available filters. In addition, the LP print service tries to match the output type of the filter with the content type of the printer. When an appropriate filter is found, the print request is passed through the filter.
A print filter handles special printing modes and requests to print specific pages. A special printing mode is needed to print any characteristics of print requests that require a customized filter.
Filters handle the following characteristics:
Printer type
Character pitch
Line pitch
Page length
Page width
Pages to print
Character set
Form name
Number of copies
The LP print service provides default settings for these characteristics. However, a print filter can handle some characteristics more efficiently. For example, some printers can handle multiple copies more efficiently than the LP print service. So, in this case, you can provide a filter for multiple-copy page control.
Each printer has its own way of detecting printer faults and transmitting fault signals to the LP print service. The LP print service only checks for hang-ups (loss of carrier) and excessive delays in printing.
Some printers provide good fault coverage and can send a message that describes the reason for a fault. Other printers indicate a fault by using signals other than the signals for loss of carrier signal or shut off of data flow. A filter is required to interpret this additional printer fault information.
A filter can also put a print request on hold, wait for a printer fault to clear, and then resume printing. With this capability, the print request that was interrupted does not need to be reprinted in its entirety. Only a filter that knows the control sequences used by a printer can determine where to break a file into pages. Consequently, only such a filter can find the place in the file where printing should start after a fault is cleared.
When a print filter generates messages, those messages are handled by the LP print service. If alerts are enabled, the LP print service sends alerts to the system administrator. For further information, see Setting Up Printer Fault Alerts by Using LP Print Commands.
A print filter can be simple or complex, but it has to meet the following requirements:
The filter should get the contents of a file from its standard input and send the converted file to the standard output.
A program cannot be used as a filter if it references external files. You might be tempted to use a program such astroff, nroff, or a similar word processing program as a filter. The LP print service does not recognize references to other files, known as include files, from a filter program. Because troff and nroff programs allow include files, they can fail when used as filters. If the program needs other files to complete its processing. The program t should not be used as a filter.
The filter should not depend on files that normally would not be accessible to a user. If a filter fails when run directly by a user, it will fail when run by the LP print service.
A slow filter can send messages about errors in the file to standard error. a fast filter should not. Error messages from a slow filter are collected and sent to the user who submitted the print request.
If a slow filter dies because it received a signal, the print request is stopped and the user who submitted the request is notified. Likewise, if a slow filter exits with a nonzero exit code, the print request is stopped and the user is notified. The exit codes from fast filters are treated differently.
If you want the filter to detect printer faults, it should also meet the following requirements:
If possible, the filter should wait for a fault to be cleared before exiting. The filter should also continue to print at the top of the page where printing stopped after the fault is cleared. If you do not want use the continuation feature, the LP print service stops the filter before alerting the administrator.
The filter should send printer fault messages to its standard error as soon as the fault is recognized. The filter does not have to exit, but can wait for the fault to be cleared.
The filter should not send messages about errors in the file to standard error. These messages should be included in the standard output, where they can be read by the user.
The filter should exit with a zero exit code if the file is finished printing (even if errors in the file have prevented it from being printed correctly).
The filter should exit with a nonzero exit code, only if a printer fault has prevented the filter from finishing a print request.
When added to the filter table, the filter must be added as a fast filter.
A print filter definition tells the LP print service about the filter, what print filter program to run, what kind of conversion the print filter does, and so on. A set of filter descriptor files are provided in the /etc/lp/fd directory. These files describe the characteristics of the filters (for example, fast filter or slow filter), and point to the filter programs (for example, /usr/lib/lp/postscript/postdaisy).
When defining a new print filter, you must create a print filter definition.
A print filter definition contains the following information used by the LP print service:
Name of the filter program to run
Input types the filter program accepts
Output types the filter program produces
Printer types to which the filter program can send jobs
Names of specific printers to which the filter program can send jobs
Filter types (either fast or slow)
Options
You can type the characteristics as direct input to the lpfilter command. You also can create a file that specifies the filter's characteristics, and use the file name as input to the lpfilter command arguments. Such a file is called a filter descriptor file and should be located in the /etc/lp/fd directory. These files are not the filters themselves. Rather, these files point to the filters.
Whether you store the information in a file, or type the information directly on the command line, use 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 |
If you provide more than one definition (that is, more than one line) for any filter characteristic other than Options, only the second definition is used by the print service.
The information can be arranged in any order, and not all the information is required. When you do not specify values, the values shown in the following table are assigned by default. These values are not very useful, which is why you should specify values.
Table 10–1 Default Values for lpfilter Command
Item |
Default Value |
---|---|
Input types |
any |
Output type |
any |
Printer types |
any |
Printers |
any |
Filter type |
slow |
Use the full path of the filter program. If there are any fixed options that the program always needs, include them here.
Input types is a list of file content types that the print filter can process. The LP print service does limit the number of input types, but most filters can accept only one input type. Several file types can be similar enough, such that the filter can deal with them. You can use whatever names you prefer, with a maximum of 14 alphanumeric characters and dashes. Do not use underscores as part of the input type name.
The LP print service uses these names to match a filter to a file type, so follow a consistent naming convention. For example, if more than one filter can accept the same input type, use the same name for that input type when you specify it for each filter. Inform your users of these names so that they know how to identify the file type when submitting a file for printing.
Output types is list of file types that the filter can produce as output. For each input type, the filter produces a single output type. The output type can vary, however, from job to job. The name of the output type is restricted to 14 alphanumeric characters and dashes.
The output type names should either match the types of available (local or remote) printers, or match the input types handled by other filters. The LP print service groups filters in a shell pipeline if it finds that several passes by different filters are needed to convert a file. You will unlikely need this level of sophistication, but the LP print service allows it. Try to find a set of filters that takes as input types all the different files the users might want printed, and that converts those files directly into file types the printer can handle.
Printer types is a list of the types of printers into which the print filter can convert files. For most printers and filters, you can leave this part of the filter definition blank, because this list is identical to the list of output types. However, this list can be different. For example, you could have a printer with a single printer type for purposes of initialization. However, that printer can recognize several different file content types. Essentially, this printer has an internal filter that converts the various file types into a filter type that it can handle. Thus, a filter might produce one of several output types that match the file types that the printer can handle. The print filter should be marked as working with that printer type.
As another example, you might have two different models of printers that are listed as accepting the same file types. Due to slight differences in manufacture, however, one printer deviates in the results it produces. You label the printers as being of different printer types, say A and B, where B is the printer that deviates. You create a filter that adjusts files to account for the deviation produced by printers of type B. Because this filter is needed only for those printer types, you would list this filter as working only on type B printers.
A print filter normally can work with all printers that accept its output, so you can usually skip this part of the filter definition.
You might, however, have some printers that are inappropriate for the output that the filter produces. For example, you might want to dedicate one printer for fast turnaround, only sending files that require no filtering to that printer. Other printers of identical type can be used for files that need extensive filtering before they can be printed.
The LP print service recognizes fast filters and slow filters, as described in Types of Filters.
Slow filters that are invoked by printing modes, by using the lp -y command, must be run on the system from which the print request originated. The LP print service cannot pass values for modes to print servers. It can, however, match a file content type (specified after the -T option of the lp command) to a content type on a print server. Therefore, if you want to activate special modes on a print server, you must specify content types that permit the LP print service to match input types and output types.
Options specify how different types of information are converted into command-line arguments to the filter command. This information can include specifications from a user (with the print request), the printer definition, and the specifications implemented by any filters that are used to process the request.
There are 13 sources of information for defining print filter options, each of which is represented by a keyword. Each option is defined in a template. A template is a statement in a filter definition that defines an option to be passed to the filter command, based on the value of one of the filter characteristics
The options specified in a filter definition can include none, all, or any subset of the 13 keywords. In addition, a single keyword can be defined more than once, if multiple definitions are required for a complete filter definition. The following table contains descriptions of the 13 keywords available for defining options in a print filter definition.
Table 10–2 Keywords for Print Filter Options
Keyword |
Patterns |
Example |
|
---|---|---|---|
Content type (input) |
INPUT |
content-type |
troff |
Content type (output) |
OUTPUT |
content-type |
postscript, impress |
Printer type |
TERM |
printer-type |
att495 |
Printer name |
PRINTER |
printer-name |
lp1 |
Character pitch |
CPI |
scaled-decimal |
10 |
Line pitch |
LPI |
scaled-decimal |
6 |
Page length |
LENGTH |
scaled-decimal |
66 |
Page width |
WIDTH |
scaled-decimal |
80 |
Pages to print |
PAGES |
page-list |
1-5,13-20 |
Character set |
CHARSET |
character-set |
finnish |
Form name |
FORM |
form-name |
invoice2 |
Number of copies |
COPIES |
integer |
3 |
MODES |
mode |
landscape |
A print filter definition can include more than one template. Multiple templates are entered on a single line and separated with commas, or they are entered on separate lines, preceded by the Options: prefix.
The format of a template is as follows: keywordpattern = replacement
The keyword identifies the type of option being registered for a particular characteristic of the filter.
The pattern is a specific option for the keyword.
The replacement is what happens when the keyword has the noted value.
For an example of how an option is defined for a particular filter, suppose you want to have the print service scheduler assign print requests to filters following this criteria:
If the type of OUTPUT to be produced by the filter is impress, then pass the -I option to the filter.
If the type of OUTPUT to be produced by the filter is postscript, then pass the -P option to the filter.
To specify these criteria, provide the following templates as options to the lpfilter command:
Options: OUTPUT impress=-I, OUTPUT postscript=-P |
If the Options line becomes too long, put each template on a separate line, as follows:
Options: OUTPUT impress=-I Options: OUTPUT postscript=-P |
In both templates, the keyword is defined as OUTPUT. In the first template, the pattern is impress, and the value of the replacement is --I. In the second template, the value of pattern is postscript, and the value of replacement is -P.
To determine which values to supply for each type of template (that is, for the pattern and replacement arguments for each keyword), consider the following:
The values for the INPUT templates come from the file content type that needs to be converted by the filter.
The values for the OUTPUT templates come from the output type that has to be produced by the filter.
The value for the TERM template is the printer type.
The value for the PRINTER template is the name of the printer that will print the final output.
The values for the CPI, LPI, LENGTH, and WIDTH templates come from the user's print request, the form being used, or the default values for the printer.
The value for the PAGES template is a list of pages that should be printed. Typically, the value consists of a list of page ranges separated by commas. Each page range consists of a pair of numbers separated by a dash, or a single number. (For example, 1–5,6,8,10 indicates pages 1 through 5, plus pages 6, 8, and 10.) However, whatever value was given in the -P option to a print request is passed unchanged.
The value for the CHARSET template is the name of the character set to be used.
The value for the FORM template is the name of the form requested by the lp -f command (the command used to submit a print request).
The value of the COPIES template is the number of copies of the file to print. If the filter uses this template, the LP print service reduces to one the number of copies of the filtered file it prints. This “single copy” includes the multiple copies that are produced by the filter.
The value of the MODES template comes from the lp -y command. Because a user can specify several -y options, the MODES template might have several values. The values are applied in the left-to-right order given by the user.
The replacement option shows how the value of a template should be given to the filter program. This part typically a literal option, sometimes with the placeholder asterisk (*) included to show where the value goes. The pattern and replacement options also can use the regular expression syntax of the ed command for more complex conversion of user input options into filter options. All regular expression syntax of ed is supported, including the \( ... \) and \n constructions. These constructions can be used to extract portions of the pattern option for copying into the replacement option, and the & option, which can be used to copy the entire pattern option into the replacement option. For more information, see the ed(1) man page.
If a comma or an equal sign (=) is included in a pattern or a replacement option, precede it with a backslash (\). A backslash in front of any of these characters is removed when the pattern or replacement option is used.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Create a print filter program.
For information on print filter programs, see Writing a Print Filter Program. By convention, filter programs for PostScript printers are located in the /usr/lib/lp/postscript directory. You should put programs you create under the /usr/lib/lp directory in a directory of your choosing.
Create a print filter definition.
For information on print filter definitions, see Creating a Print Filter Definition. You should save the print filter definition in a text file. By convention, filter definitions are located in the /etc/lp/fd directory and are identified with the .fd suffix.
Add the print filter to a print server.
For instructions, see How to Add a Print Filter.
This example shows a print filter definition that is used to convert N37 or Nlp to simple.
Input types: N37, Nlp, simple Output types: simple Command: /usr/bin/col Options: MODES expand = -x Options: INPUT simple = -p -f |
In this example, the print filter program is named col. Once you add the new print filter to a print server, a user's print requests are handled as follows:
When a user types the following command:
$ lp -y expand report.doc |
The print filter program is run with the following arguments to convert the file:
/usr/bin/col -x -p -f |
When a user types the following command:
$ lp -T N37 -y expand report.doc |
The print filter program is run with the following arguments to convert the file:
/usr/bin/col -x |
This example shows a print filter definition that is used to convert from troff to a PostScript file.
Input types: troff Output types: postscript Printer types: PS Filter type: slow Command: /usr/lib/lp/postscript/dpost Options: LENGTH * = -l* Options: MODES port = -pp, MODES land = -pl Options: MODES group \=\([1-9]\) = -n\l |
In this example, the filter program is named dpost. The filter program takes one input type, troff, produces a postscript output, and works with any printer of type PS (PostScript). Users need to give just the abbreviation port or land when they ask for the paper orientation to be in either portrait mode or landscape mode. Because these options are not intrinsic to the LP print service, users must specify them by using the lp -y command.
After you add the new print filter to a print server, print requests will be handled as follows:
When a user types the following command to submit a troff file type for printing on a PostScript printer (type PS), with requests for landscape orientation and a page length of 60 lines:
$ lp -T troff -o length=60 -y land -d luna ch1.doc |
The print filter program dpost is run with the following arguments to convert the file:
/usr/lib/lp/postscript/dpost -l60 -pl |
When a user enters the following command:
$ lp -T troff -y group=4 -d luna ch1.doc |
The print filter program dpost is run with the following arguments to convert the file:
/usr/lib/lp/postscript/dpost -n4 |
Print filters are programs that convert the content type of a file to a content type that is acceptable to the destination printer.
The LP print service uses filters to complete the following tasks:
Convert a file from one data format to another format so that it can be printed properly on a specific type of printer
Handle the special modes of printing, such as two-sided printing, landscape printing, draft-quality, and letter-quality printing
Detect printer faults and notify the LP print service, 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, the tasks can be implemented separately.
The LP print service provides the PostScript filters listed in Table 10–3. The filter programs are located in the /usr/lib/lp/postscript directory. For PostScript printing, you usually only need to install the filter programs when setting up a print server. Solaris Print Manager automatically enables the supplied filters. However, if you administer other printers, you might need to administer print filters for them.
To create a new print filter, you must write a print filter program and create a print filter definition. Filters contain input types, output types, and complex options that provide a language to process command-line arguments within the filter. For more information and step-by-step instructions, see Creating a New Print Filter.
Print filters are added, changed, deleted, or restored on the print server only.
You can 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 that are supplied (PostScript only) are located in the /etc/lp/fd directory. The actual filter programs are located in the /usr/lib/lp directory.
The LP print service imposes no fixed limit on the number of print filters you can define. You can remove filters that are no longer used to avoid extra processing by the LP print service. (LP examines all filters to find a filter that works for a specific print request.) If in doubt, do not remove a filter.
As you add, change, or delete filters, you can overwrite or remove some of the original filters provided by the LP print service. You can restore the original set of filters, if necessary. You can also remove any filters you have added.
SunOS software provides a default set of PostScript filters. Solaris Print Manager automatically adds these filters to a print server. Some of the TranScript filters used with LPD-based print services have SunOS equivalents, but other TranScript filters do not. The following table lists the default PostScript filters and identifies the equivalent TranScript filters, where applicable.
Table 10–3 Default PostScript Filters
PostScript Filter |
Action |
TranScript Equivalent |
---|---|---|
download |
Used to download fonts |
|
dpost |
Changes ditroff to PostScript |
psdit |
postdaisy |
Changes daisy to PostScript | |
postdmd |
Changes dmd to PostScript | |
postio |
Used for serial interface for PostScript printer |
pscomm |
postior |
Used to communicate with printer | |
postmd |
Changes matrix gray scales to PostScript | |
postplot |
Changes plot to PostScript |
psplot |
postprint |
Changes simple to PostScript |
enscript |
postreverse |
Used to reverse or select pages |
psrev |
posttek |
Changes TEK4014 to PostScript |
ps4014 |
The SunOS software does not provide the following filters:
TEX
oscat (NeWSprint opost)
Enscript
The postreverse, postprint, postio, and dpost filters are provided in place of Enscript.
Solaris Print Manager adds the default PostScript filters to a print server. If you have printing needs that are not met by these filters, see How to Create a New Print Filter. This section provides information about writing a custom print filter.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Add a print filter that is based on a print filter definition.
# lpfilter -f filter-name -F filter-definition |
Specifies the name you choose for the print filter.
Specifies the name of the print filter definition.
For more information, see the lpfilter(1M) man page.
The print filter is added in the print server's /etc/lp/filter.table file.
Verify that the print filter was added.
# lpfilter -f filter-name -l |
The following example shows how to add the daisytroff print filter that has the daisytroff.fd print filter definition.
# lpfilter -f daisytroff -F /etc/lp/fd/daisytroff.fd |
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Delete the print filter.
# lpfilter -f filter-name -x |
Specifies the name of the print filter to be deleted.
Deletes the specified filter.
The print filter is deleted from the print server's /etc/lp/filter.table file.
Verify that the filter was deleted.
# lpfilter -f filter-name -l |
You should receive an error indicating that no filter by the specified name exists.
The following example shows how to delete the daisytroff print filter.
# lpfilter -f daisytroff -x |
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Request information about a print filter.
# lpfilter -f filter-name -l |
Specifies the print filter for which you want to view information. Specify all for filter-name to view information about all available print filters.
Displays information about the specified filter.
Information about the specified print filter or filters is displayed.
This example shows how to request information for the postdaisy print filter. Sample command output follows.
# 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 |
This example shows how to display all the print filters that have been added to the system. Sample command output follows.
# 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 |
This example shows how to redirect information about the daisytroff filter to a file. This task is useful if a filter definition is removed unintentionally.
# lpfilter -f daisytroff -l > daisytroff.fd |
Task |
Description |
For Instructions |
---|---|---|
Create a new form definition. |
Provide a new form definition by specifying information for nine required printer characteristics. | |
Limit user access to a form. |
Control user access to printers and forms that are available on the network. | |
Add a form. |
Add the definition of a form to the list of available forms, so that the LP print service can recognize the form. | |
Delete a form. |
Remove the definition of a form from the list of available forms that are recognized by the LP print service. | |
Mount a form. |
Use the mount command to notify the LP print service to accept print requests for a form with a specific definition. | |
Set an alert to mount a form. |
Set alerts for forms that are mounted to a printer. | |
View information about a form. |
View form names and other form information by listing the contents of the /etc/lp/forms directory. | |
View the current status of a form. |
Use the lpforms command to display the current status of a form. | |
Limit printer access to a form. |
Control what forms printers have access to. |
When you want to provide a new form, you must define its characteristics by specifying information for nine required printer characteristics (such as page length and page width) as input to the lpforms command.
The LP print service uses this information to perform the following tasks:
Initialize the printer so that printing is done properly on the form
Send reminders to the system administrator about how to handle the form
The form name can be anything you choose, as long as it does not contain more than 14 alphanumeric characters or any underscores. The information must use 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 |
The optional word [,mandatory], means that the user cannot override the character set choice in the form. The content-type can be given, although this information is optional, with an alignment pattern. If this value is given, the print service uses it to determine, as necessary, how to filter and print the file.
Aside from following two exceptions, the information can appear in any order:
The Alignment pattern (which must always be last).
The comment (which must always follow the line with the Comment: prompt).
If the comment contains a line that begins with a key phrase, such as Page length, Page width, and so on, precede that line with a > character so that the key phrase is not at the beginning of the line. The initial > character is stripped from the comment and is not displayed.
Not all of the information must be given. When you do not specify values, the default values in the following table are assigned. Before running the lpforms command, gather the following information about the new form that is described in this table.
Table 10–4 Default Values for Printer Forms
Value |
Default |
Description |
---|---|---|
Page length |
66 lines |
The length of the form, or the length of each page in a multipage form. This information can be the number of lines, or the size in inches or centimeters. |
Page width |
80 columns |
The width of the form, in characters, inches, or centimeters. |
Number of pages |
1 |
The number of pages in a multipage form. The LP print service uses this number with a print filter (if available) to restrict the alignment pattern to a length of one form. See the description of alignment pattern below. If no filter is available, the LP print service does not truncate the output. |
Line pitch |
6 lines per inch |
A measurement of how close lines appear on the form. Line pitch is also called leading. Character pitch is the distance between two lines, from baseline to baseline, measured by either lines per inch or lines per centimeter. |
Character pitch |
10 characters per inch |
A measurement of how close together characters appear on the form. It is the distance between characters, measured by either characters per inch or characters per centimeter. |
Character set choice |
Any |
The character set, print wheel, or font cartridge that should be used when this form is used. Users can choose a different character set for their own print requests when using this form. Or, you can require that only one character set be used. |
Ribbon color |
Any |
If the form should always be printed using a certain color ribbon, the LP print service can give a mount alert message indicating which color to use. |
Comment |
(No default) |
Any remarks that might help users understand the form. For example, the remarks could indicate the name of the form, its revision, its purpose, or restrictions on its use. |
(No default) |
A sample file that the LP print service uses to fill one blank form. When mounting the form, you can print this pattern on the form to align it properly. You can also define a content type for this pattern so that the print service knows how to print it. |
The LP print service does not try to mask sensitive information in the alignment pattern. If you do not want sensitive information printed on sample forms, for example when you align checks, then you should mask the appropriate data. The LP print service keeps the alignment pattern stored in a safe place, where only users logged in as superuser or lp user can read it.
When you have gathered the information for the form, specify it as input to the lpforms command. You should record this information first in a separate file so that you can edit it before specifying it with the lpforms command. You can then use the file as input instead of typing each piece of information separately after a prompt.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Create a form definition file.
For a description on creating printer forms, see Creating a New Printer Form. You should save the printer definition in a text file.
Add the form to the LP print service.
# lpadmin -p printer-name -M -f form-name |
Add the form to a print server.
For instructions, see How to Add a Form.
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 has two meanings: the physical medium (the paper) and the software that defines a form to the LP print service.
The LP print service allows you to control the use of forms. This section provides information about adding, changing, deleting, mounting, and limiting access to 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 specify 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.
No form definitions are supplied with the LP print service.
To change a form, you must re-add the form with a different definition.
The LP print service imposes no limit on the number of forms you can define. However, you should delete forms that are no longer appropriate. Obsolete forms can result in unnecessary processing by the print service.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Add a form that is based on a form definition.
# lpforms -f form-name -F /etc/lp/forms/form |
Specifies the name you choose for the form
Specifies the name of the form definition.
For more information, see the lpforms(1M) man page.
The form is added to the print server's /etc/lp/forms/form-name/describe file.
Verify that the form was added by checking the output of the following command:
# lpforms -f form-name -l |
The following example shows how to add the medical form that uses the medical.fmd form definition.
# lpforms -f medical -F /etc/lp/forms/medical.fmd |
Before the form can be used, one or more printers must be given access to the form. For more information, see How to Limit Printer Access to a Form.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Delete the form.
# lpforms -f form-name -x |
Is the form to be deleted.
Deletes the specified form
The form is deleted from /etc/lp/forms/form-name file.
For more information, see the lpforms(1M) man page.
Verify that the form was deleted.
# lpforms -f form-name -l |
You should receive an error indicating that a form by the specified name does not exist.
The following example shows how to delete the medical form.
# lpforms -f medical -x |
To print a form, you must load the paper in the printer and use a command to mount the form. This command notifies the LP print service that print requests submitted to the printer are to be printed using the form definition.
If you use one printer for different types of printing, including forms, you should do the following:
Disable the printer before you load the paper and mount the form.
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, ensure that it is aligned properly. If an alignment pattern has been defined for the form, you can request that the pattern print repeatedly after you have mounted the form. Let the pattern print repeatedly until you have adjusted the printer so the alignment is correct.
When you want to change or discontinue using a form on a printer, you must notify the LP print service by unmounting the form.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Stop accepting print requests on the printer on which you are unmounting the current form.
# reject printer-name |
printer-name is the name of the printer on which you are unmounting a form.
New print requests (which might not require the form) are not allowed to enter the printer's queue.
# lpadmin -p printer-name -M -f none |
In this command, the variable printer-name is the same variable that is used in Step 2.
The current form is deleted from the print server's /etc/lp/printers/printer-name/configuration file.
Load the new form paper for the next print request.
Mount the form.
# lpadmin -p printer-name -M -f form-name[-a -o filebreak] |
Specifies the printer on which you are mounting a form.
Specifies the name of the form to be mounted.
Optionally enables you to print a copy of the alignment pattern defined for the form, if this definition exists.
Printer on which you are mounting a form.
Name of the form to be mounted.
The specified form is added in the print server's /etc/lp/printers/printer-name/configuration file.
Start accepting print requests on the printer.
# accept printer-name |
The printer is ready to print the form you just mounted.
Verify that the form has been mounted.
# lpstat -p printer-name -l |
Otherwise, submit a print request that requires the new form and check the printer for output.
The following example shows the process of unmounting the currently mounted form on the printer luna.
# reject luna destination "luna" will no longer accept requests # lpadmin -p luna -M f none # accept luna destination "luna" now accepting requests |
The following example shows the process of mounting the medical form on the printer luna.
# reject luna destination "luna" will no longer accept requests # lpadmin -p luna -M f medical -a -o filebreak # accept luna destination "luna" now accepting requests |
The LP print service helps you track which forms are mounted on each printer. The print service also notifies you when it cannot find a description it needs to print a form. You are responsible for creating form descriptions, and mounting and unmounting form paper in each printer. You complete this task either as part of setting up a printer or in response to alerts from the LP print service.
Users can specify the form on which they want a job to print. As superuser, you can mount a specific form, then tell the LP print service that the form is available and on which printer it is mounted. Users can submit print requests specifying a particular form. When the LP print service receives the request, it sends an alert message to root requesting that you mount the form.
You request alerts for mounting forms in the same way that you request other alerts from the LP print service. For general information about alerts, see Setting Up Printer Fault Recovery by Using LP Print Commands.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Set a request alert for mounting a form.
# lpforms -f form-name -A alert [-Q requests] [-W minutes] |
Specifies the form for which you want to set a request alert.
Specifies what kind of alert will occur when a form is requested. Some valid values are mail, write, and quiet. If you choose mail or write, a predefined alert message says to mount the specified form. The message includes names of one or more printers that have been set up to use the form.
Specifies how many print requests that require the form must be in the queue to trigger an alert. If you don't specify this option, an alert occurs with just one print request in the queue.
Specifies how often (in minutes) the alert will occur. If you don't specify this option, the alert is sent one time.
The request alert is added to the print server's /etc/lp/forms/form-name/alert.sh file.
Verify that the alert has been added for the form.
# lpforms -f form-name -A list |
Alternately, if you have set a low number of print requests to trigger the alert, submit print requests to meet the minimum requirement. Ensure that you receive an alert to mount the form.
This example shows how to set email alerts to occur every 5 minutes for the letterhead form when 10 print requests for letterhead reside in the print queue.
# lpforms -f letterhead -A mail -Q 10 -W 5 |
This example shows how to set console window alerts to occur every 10 minutes for the letterhead form when 5 requests for letterheadreside in the print queue.
# lpforms -f letterhead -A write -Q 5 -W 10 |
This example shows how to set no request alerts for the invoice form.
# lpforms -f invoice -A none |
When you have defined a form for the LP print service, you can check the form with either of two commands. Which command you choose depends on the type of information you want to check.
To show the attributes of the form, use the lpforms command. You can also redirect the output of the command into a file to save it for future reference.
To display the current status of the form, use the lpstat command. 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 view the form names by listing the contents of the /etc/lp/forms directory.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Request information about a form.
# lpforms -f form-name -l |
Specifies the form for which you want to view information. Specify all for form-name to view information about all the available forms.
Lists the specified form.
Information about the specified form or forms is displayed.
The following example shows how to display information about the medical form.
# 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: Medical claim form |
The following example shows how to redirect the information about the medical form to a file. This command creates the form definition for the form. This command is useful if a form definition is removed unintentionally.
# lpforms -f medical -l > medical.fmd |
Log in on the print server.
Request information about the current status of a form.
$ lpstat -f form-name |
The -f option specifies the form for which you want to view the current status. Specify all for form-name to view the current status of all the forms.
Information about the current status of the specified form or forms is displayed.
This example shows how to display the status of the medical form.
$ lpstat -f medical form medical is available to you |
You can control which printers and which users have access to some or all of the forms available on the network. For example, you might want only the people in the payroll or accounts payable department to be able to print check forms. In addition, you might want the check forms to be available only on certain printers.
For more information, see How to Limit User Access to a Form. To limit printer access to a form, see How to Limit Printer Access to a Form.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Allow or deny users access to a form.
# lpforms -f form-name -u allow:user-list | deny:user-list |
Specifies the name of the form for which the allow user access lists or the deny user access list is being created.
Represents users to be added to the allow user access list. Use a comma or a space to separate user login IDs. If you use spaces, enclose the list of IDs in quotation marks.
Table 6–6 provides the valid values for user-list.
Represents users to be added to the deny user access list. Use a comma or a space to separate user login IDs. If you use spaces, enclose the list of IDs in quotation marks. Table 6–6 provides the valid values for user-list.
The specified users are added to the appropriate user access list for the specified form in one of the following files on the print server:
/etc/lp/forms/form-name/allow
/etc/lp/forms/form-name/deny
Verify that the allow user access list and deny user access list are set up correctly.
# lpforms -f form-name -l |
This example shows how to allow only the users nathan and marcia access to the check form.
# lpforms -f check -u allow:nathan,marcia |
This example shows how to deny users jones and smith access to the dental form.
# lpforms -f dental -u deny:jones,smith |
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Allow or deny use of forms on a printer.
# lpadmin -p printer-name -f allow:form-list | deny:form-list |
Specifies the name of the printer for which the allow forms list or deny forms list is being created.
Specifies the form name to be added to the allow list. Use a space or a comma to separate multiple form names. If you use spaces to separate form names, enclose the list of form names in quotation marks.
Is the form name to be added to the deny list. Use a space or a comma to separate multiple form names. If you use spaces to separate form names, enclose the list of form names in quotation marks.
The specified form or forms are added to the allow forms list or the deny forms list in one of the following files on the print server:
/etc/lp/printers/printer-name/form.allow
/etc/lp/printers/printer-name/form.deny
Verify that the allow forms list and the deny forms list are set up correctly.
# lpstat -p printer-name -l |
This example shows how to allow the printer luna to access only the medical, dental, and check forms.
# lpadmin -p luna -f allow:medical,dental,check |
This example shows how to deny the printer luna from accessing the medical, dental, and check forms.
# lpadmin -p luna -f deny:"medical dental check" |
Task |
Description |
For Instructions |
---|---|---|
Install downloaded PostScript fonts. |
Permanently download a font if most print requests serviced by the printer use that font. To avoid transmitting fonts across the network, add all the printer-resident fonts. | |
Install host-resident PostScript fonts. |
Install host-resident fonts on a system that is shared by many users. Use this method when numerous fonts are available, or when these fonts are not used by all print requests. |
If you have a laser printer, you might need to install and maintain PostScript fonts. 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, the font 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 can 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 can be reserved for the printer administrator. You should permanently download a font if most print requests serviced by the printer use that 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 that is shared by many users. The system that stores the fonts can be a print server or a print client. Each user can request fonts in the document to be printed. This method is useful when numerous fonts are available, or when these fonts are not used by all print requests. If the fonts will be used only on printers attached to a print server, they should be stored on the print server. If the fonts will be used by the users on one system and those users can submit requests to multiple printers on a network, the fonts should be stored on the users' system.
The LP print service provides a special download filter to manage host-resident fonts. The LP print service also supplies troff width tables for the 35 standard PostScript fonts that reside on many PostScript printers. For more information about the troff program, see the troff(1) man page.
Most PostScript printers come equipped with fonts that are 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 this file:
/etc/lp/printers/printer-name/residentfonts |
When the printer is attached to a print server, ensure that the list in the residentfonts file includes fonts that are on the print server. The file must also include fonts that are available for downloading to the printer.
You must edit the files that contain the list of printer-resident fonts by using a text editor such as vi.
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. Also, a fast filter must have access to the printer while the filter is processing. A slow filter takes longer to convert a file. However, a slow filter does not need to access the printer while the filter is processing. An example of a slow filter is a filter that converts an ASCII document to a PostScript document.
The download filter is a fast filter. This filter downloads fonts automatically if the fonts are on the print server. The download filter can also be used to send fonts to a print server. To do so, you can create a new filter table entry that calls the download filter as a slow filter by using the lp -y command. Alternatively, you can force selection of this filter by changing the input type.
The download filter performs five tasks:
The filter 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.
The download filter searches the list of printer-resident fonts to determine if the requested font must be downloaded.
If the font is not resident on the printer, the download filter searches the host-resident font directory table to determine if the requested font is available. This filter performs this search by getting the appropriate file name from the map.
If the font is available, the download filter takes the file for that font and appends it to the file to be printed.
The download filter sends the font definition file and the source file to the PostScript printer. The source file is the file to be printed.
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. A map file shows the correspondence between the names of fonts and the names of the files that contain those fonts. Both the map file 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 that you create. These directories are called /usr/share/lib/hostfontdir/typeface/font. The variable typeface is replaced by a name, such as palatino or helvetica. The variable font is replaced by a an attribute name, such as bold or italic.
On the print server, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Change directory to the /etc/lp/printers/printer-name directory.
# cd /etc/lp/printers/printer-name |
The variable printer-name specifies the name of the printer on which you want to install downloaded PostScript fonts.
Create the residentfonts file, if this file does not already exist.
# touch residentfonts |
This file might not exist if you are adding permanently downloaded fonts for the first time.
Edit the residentfonts file. Add all the printer-resident fonts and the fonts to be permanently downloaded.
On the print server or the print client, become superuser or assume an equivalent role.
Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.
Create the hostfontdir directory.
# cd /usr/share/lib |
Create a directory for a new typeface, if the directory does not already exist.
# mkdir typeface |
Copy the font file to the appropriate directory.
# cp filename /usr/share/lib/hostfontdir/typeface/font |
Add to the map file the name of the font and the name of the file in which it resides.
Change to the /usr/share/lib/hostfontdir directory.
Edit the map file by using a text editor such as the vi editor.
Add a one-line entry for each font that you want to add to the file. Put the font name first, followed by a space, followed by the name of the file where the font resides. For example:
Palatino-Bold /usr/share/lib/hostfontdir/palatino/bold |
Save the file.
When an example entry exists in the map file on the appropriate system, users can apply the font (for example, Palatino Bold) to their print jobs. When users submit a print request that contains this font, the LP print service appends a copy of the /usr/share/lib/hostfontdir/palatino/bold file to that file before sending it to the printer.
If you are using the troff program, you must create new width tables for this font in the standard troff font directory.