lpforms Command

Note: This is a System V Print Subsystem command.

Purpose

Administer forms used with the LP print service.

Syntax

lpforms -f FormName Options

lpforms -f FormName -A AlertType [-Q minutes] [-W requests]

Description

The lpforms command is used to administer the use of preprinted forms, such as company letterhead paper, with the LP print service. A form is specified by its FormName. Users may specify a form when submitting a print request (see the lp command). The parameter all can be used instead of FormName with either of the command lines shown above. The first command line allows the administrator to add, change, and delete forms, to list the attributes of an existing form, and to allow and deny users access to particular forms. The second command line is used to establish the method by which the administrator is alerted that the form FormName must be mounted on a printer.

If you enter lpforms -?, the system displays the command usage message and returns 0.

With the first lpforms command line, one of the following flags must be used:

Flags

Item Description
- (hyphen) Adds or changes form FormName, as specified by the information from standard input.
-F pathname Adds or changes form FormName, as specified by the information in pathname.
-l Lists the attributes of form FormName.
-x Deletes form FormName (this flag must be used separately; it may not be used with any other flag).

Adding or changing a form

The -F pathname flag is used to add a new form, FormName, to the LP print service, or to change the attributes of an existing form. The form description is taken from pathname if the -F flag is given, or from the standard input if the - flag is used. One of these two flags must be used to define or change a form. pathname is the pathname of a file that contains all or any subset of the following information about the form:

   Page length: scaled-decimal-number1
   Page width: scaled-decimal-number2
   Number of pages: integer
   Line pitch: scaled-decimal-number3
   Character pitch: scaled-decimal-number4
   Character set choice: character-set/print-wheel [mandatory]
   Ribbon color: ribbon-color
   Comment:
   comment
   Alignment pattern: [content-type]
   content

The term "scaled-decimal-number" refers to a non-negative number used to indicate a unit of size. The type of unit is shown by a "trailing" letter attached to the number. Three types of scaled decimal numbers can be used with the LP print service: numbers that show sizes in centimeters (marked with a trailing "c"); numbers that show sizes in inches (marked with a trailing "i"); and numbers that show sizes in units appropriate to use (without a trailing letter), that is, lines, characters, lines per inch, or characters per inch.

Except for the last two lines, the above lines may appear in any order. The Comment and comment items must appear in consecutive order but may appear before the other items, and the "Alignment pattern" and the content items must appear in consecutive order at the end of the file. Also, the comment item may not contain a line that begins with any of the key phrases above, unless the key phrase is preceded with a ">". Any leading ">" sign found in the comment are removed when the comment is displayed. Case distinctions in the key phrases are ignored.

When this command is issued, the form specified by FormName is added to the list of forms. If the form already exists, its description is changed to reflect the new information. Once added, a form is available for use in a print request, except where access to the form has been restricted, as described under the -u flag. A form may also be allowed to be used on certain printers only.

A description of each form attribute is below:

Item Description
Page length and Page width Before printing the content of a print request needing this form, the generic interface program provided with the LP print service initializes the physical printer to handle pages scaled-decimal-number1 long, and scaled-decimal-number2 wide using the printer type as a key into the terminfo database.

The page length and page width are also passed, if possible, to each filter used in a request needing this form.

Number of pages Each time the alignment pattern is printed, the LP print service attempts to truncate the content to a single form by, if possible, passing to each filter the page subset of 1-integer.
Line pitch and Character pitch Before printing the content of a print request needing this form, the interface programs provided with the LP print service initializes the physical printer to handle these pitches, using the printer type as a key into the terminfo database. Also, the pitches are passed, if possible, to each filter used in a request needing this form. scaled-decimal-number3 is in lines per centimeter if a "c" is appended, and lines per inch otherwise; similarly, scaled-decimal-number4 is in characters per centimeter if a "c" is appended, and characters per inch otherwise. The character pitch can also be given as elite (12 characters per inch), pica (10 characters per inch), or compressed (as many characters per inch as possible).
Character set choice When the LP print service alerts an administrator to mount this form, it also mentions that the print wheel print-wheel should be used on those printers that take print wheels. If printing with this form is to be done on a printer that has selectable or loadable character sets instead of print wheels, the interface programs provided with the LP print service automatically selects or loads the correct character set. If mandatory is appended, a user is not allowed to select a different character set for use with the form; otherwise, the character set or print wheel named is a suggestion and a default only.
Ribbon color When the LP print service alerts an administrator to mount this form, it also mentions that the color of the ribbon should be ribbon-color.
Comment The LP print service displays the comment unaltered when a user asks about this form (see the lpstat command).
Alignment pattern When mounting this form, an administrator can ask for the content to be printed repeatedly, as an aid in correctly positioning the preprinted form. The optional content-type defines the type of printer for which content had been generated. If content-type is not given, simple is assumed.
Note: The content is stored as given and is readable only by the user lp.

When an existing form is changed with this command, items missing in the new information are left as they were. When a new form is added with this command, missing items gets the following defaults:

   Page Length: 66
   Page Width: 80
   Number of Pages: 1
   Line Pitch: 6
   Character Pitch: 10
   Character Set Choice: any
   Ribbon Color: any

Deleting a form

The -x flag is used to delete the form FormName from the LP print service.

Listing form attributes

The -l flag is used to list the attributes of the existing form FormName. Because of the potentially sensitive nature of the alignment pattern, only the administrator can examine the form with this command. Other people may use the lpstat command to examine the non-sensitive part of the form description.

Allowing and denying access to a form

The -u flag, followed by the parameter allow:login-ID-list or -u deny:login-ID-list lets you determine which users are allowed to specify a particular form with a print request. This flag can be used with the -F or - flag.

The login-ID-list parameter may include any or all of the following constructs:

Item Description
login-ID A user on the local system
system-name!login-ID A user on system system-name
system-name!all All users on system system-name
all!login-ID A user on all systems
all All users on the local system
all!all All users on all systems

The default value of login-ID-list is all.

The LP print service keeps two lists of users for each form: an "allow-list" of people allowed to use the form, and a "deny-list" of people that may not use the form.

If the allow-list is not empty, only the users in the list are allowed access to the form, regardless of the contents of the deny-list. If the allow-list is empty but the deny-list is not, the users in the deny-list may not use the form (but all others may use it).

All users can be denied access to a form by specifying -f deny:all. All users can be allowed access to a form by specifying -f allow:all. (This is the default.)

Setting an alert to mount a form

The -f FormName flag is used with the -A AlertType flag to define an alert to mount the form when there are queued jobs which need it. If this flag is not used to arrange alerting for a form, no alert is sent for that form.

The method by which the alert is sent depends on the value of the AlertType parameter specified with the -A flag. The alert types are the same as those available with the -A flag to lpadmin: mail, write, quiet, none, shell-command, and list. See the description of -A on lpadmin for details about each.

The message sent appears as follows:

   The form FormName needs to be mounted
   on the printer(s):
   printer (integer1 requests).
   integer2 print requests await this form.
   Use the ribbon-color ribbon.
   Use the print-wheel print wheel, if appropriate.

The printers listed are those that the administrator had earlier specified were candidates for this form. The number integer1 listed next to each printer is the number of requests eligible for the printer. The number integer2 shown after the list of printers is the total number of requests awaiting the form. It is less than the sum of the other numbers if some requests can be handled by more than one printer. The ribbon-color and print-wheel are those specified in the form description. The last line in the message is always sent, even if none of the printers listed use print wheels, because the administrator may choose to mount the form on a printer that does use a print wheel.

Where any color ribbon or any print wheel can be used, the statements above read:

Use any ribbon.
   Use any print-wheel.

If FormName is any, the alerting defined in this command applies to any form for which an alert has not yet been defined. If FormName is all, the alerting defined in this command applies to all forms.

If the -W flag is not given, the default procedure is that only one message is sent per need to mount the form. Not specifying the -W flag is equivalent to specifying -W once or -W 0. If minutes is a number greater than 0, an alert is sent at intervals specified by minutes.

If the -Q flag is also given, the alert is sent when a certain number (specified by the parameter requests) of print requests that need the form are waiting. If the -Q flag is not given, or the value of requests is 1 or any (which are both the default), a message is sent as soon as anyone submits a print request for the form when it is not mounted.

Listing the current alert

The -f flag, followed by the -A flag and the parameter list is used to list the type of alert that has been defined for the specified form FormName. No change is made to the alert. If FormName is recognized by the LP print service, one of the following lines is sent to the standard output, depending on the type of alert for the form.

   When requests requests are queued:
   alert with shell-command every minutes minutes

   When requests requests are queued:
   write to user-name every minutes minutes

   When requests requests are queued:
   mail to user-name every minutes minutes

   No alert

The phrase "every minutes minutes" is replaced with "once" if minutes (-W minutes) is 0.

Terminating an active alert

The -A quiet flag is used to stop messages for the current condition. An administrator can use this flag to temporarily stop receiving further messages about a known problem. Once the form has been mounted and then unmounted, messages are again sent when the number of print requests reaches the threshold requests.

Removing an alert definition

No messages are sent after the -A none flag is used until the -Aflag is given again with a different AlertType. This can be used to permanently stop further messages from being sent as any existing alert definition for the form is removed.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in AIX® Version 7.1 Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.