Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
6.  Managing Character Sets, Filters, Forms, and Fonts (Tasks) Managing Print Filters  Previous   Contents   Next 
   
 

Creating Print Filters

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 background information and step-by-step instructions, see "Creating a New Print Filter".

Adding, Changing, Removing, and Restoring Print Filters

Print filters are added, changed, or removed 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 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 one 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, and remove any filters you have added.

SunOS software provides a default set of PostScript filters, which Solaris Print Manager automatically adds to a print server. Some of the TranScript filters used with lpd-based print services have SunOS equivalents, but others do not. The following table lists the default PostScript filters and identifies the TranScript filters, where applicable.

Table 6-1 Default PostScript Filters

Filter

Action

TranScript Equivalent

download

Download fonts

 

dpost

ditroff to PostScript

psdit

postdaisy

daisy to PostScript

 

postdmd

dmd to PostScript

 

postio

Serial interface for PostScript printer

pscomm

postior

Communicate with printer

 

postmd

Matrix gray scales to PostScript

 

postplot

plot to PostScript

psplot

postprint

simple to PostScript

enscript

postreverse

Reverse or select pages

psrev

posttek

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" for information about writing a custom print filter.

How to Add a Print Filter

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Add a print filter that is based on a print filter definition.

    # lpfilter -f filter-name -F filter-def

    -f filter-name

    Name you choose for the print filter.

    -F filter-def

    Name of the print filter definition.

    For more information, see lpfilter(1M).

    The print filter is added in the print server's /etc/lp/filter.table file.

  3. Verify that the print filter was added by checking for information about the print filter in the output of the following command.

    # lpfilter -f filter-name -l

Example--Adding a Print Filter

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

How to Delete a Print Filter

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Delete the print filter.

    # lpfilter -f filter-name -x

    -f filter-name

    Name of the print filter to be deleted.

    -x

    Deletes the specified filter.

    The print filter is deleted from the print server's /etc/lp/filter.table file.

  3. Verify that filter was deleted.

    # lpfilter -f filter-name -l

    You should receive an error indicating that no filter by the specified name exists.

Example--Deleting a Print Filter

The following example shows how to delete the daisytroff print filter.

# lpfilter -f daisytroff -x

How to View Information About a Print Filter

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Request information about a print filter.

    # lpfilter -f filter-name -l

    -f filter-name

    Print filter for which you want to view information. Specify all for filter-name to view information about all the available print filters.

    -l

    Displays information about the specified filter.

    Information about the specified print filter(s) is displayed.

Examples--Viewing Information About a Print Filter

The following example shows how to request information for the postdaisy print filter, and the information that is displayed in response.

# 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

The following example shows how to redirect information about the daisytroff filter to a file (create the filter definition for that filter). This is useful if a filter definition is removed unintentionally.

# lpfilter -f daisytroff -l > daisytroff.fd

The following example shows how to display all the print filters that have been added to the system, and the information that is displayed in response.

# 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
 
 
 
  Previous   Contents   Next