6    Creating and Managing Queues and Printers

This chapter describes:

For detailed descriptions of the commands used in this section, refer to the Advanced Printing Software Command Reference Guide.

6.1    Creating and Managing Queues

The logical and physical printer abstractions are joined by way of queues. By associating each logical printer and physical printer with a queue object, you establish a relationship between the printer that the user specifies for printing and the physical printer defined by characteristics of the output device.

When you create a queue, you associate it with a spooler. The associated spooler does the following:

You can use the pdcreate command or the pdprintadmin GUI to create queues. When you use the pdprintadmin GUI to create a printer, you are asked if you want the print system to automatically create the queue.

Use pdcreate to create queues. The pdcreate command has the following command-line syntax:

pdcreate [-c class_name] [-x extended_attribute_string] [-X attribute_filename]

6.1.1    Enabling a Queue

Use the pdenable command to enable a queue. When you enable a queue, the queue accepts print jobs.

The pdenable command has the following command-line syntax:

pdenable -c queue [-m message text] [-x extended_attribute_string] [-X attribute_filename] queue_name

6.1.2    Disabling a Queue

Use the pddisable command to disable a queue. When you disable a queue, the queue does not accept print jobs. The pddisable command has the following command-line syntax:

pddisable -c queue [-m message text] [-x extended_attribute_string] [-X attribute_filename] queue_name

6.1.3    Removing All Jobs from a Queue

Operators and Administrators can use the pdclean command to remove all jobs from a queue.

When you use the pdclean command to remove all jobs from a queue, jobs that are currently printing, retained, or processing at associated physical printers are deleted. Before the command can be executed, the queue must be disabled.

6.1.4    Determining Queue States

The attribute state contains the current state of a queue. A queue can be in one of the two states described below:

A queue is paused with the pdpause command and is resumed with the pdresume command.

6.1.5    Setting Limits for Queue Backlog Events

You can set the limits at which the queue is considered backlogged and not backlogged. You can also control whether the spooler disables and enables a queue when the number of jobs reaches these limits.

By setting the queue-backlog-upper-limit attribute and the queue-backlog-lower-limit attribute, you specify the number of pending jobs in a queue that causes an event to be delivered. When the upper limit number is reached, you receive a notification message. When the number of pending jobs decreases to the lower limit, the queue is no longer backlogged and another event is declared.

If you set the disable-backlogged-queue=yes attribute, the spooler automatically disables the queue when the number of pending jobs reaches the upper limit that you set; it automatically enables the queue when the lower limit is reached. If disable-backlogged-queue=no, which is the default, the spooler does not disable or enable backlogged queues.

You can use the pdset or the pdcreate command to set the queue backlog upper and lower limits.

You can apply these attributes to all queues on a spooler by replacing the queue name with the spooler name followed by a colon; for example, my_splr:.

6.1.6    Listing Queue Attributes

You can use the pdls command to display the attributes of a queue.

6.2    Creating and Managing Physical Printers

In a print system, a physical printer is the object that represents an output device.

Each supported physical printer has a Printer Attribute File (PAF) for the printer. The PAF file contains the recommended settings for attributes needed to communicate with and control the printer. You can determine the appropriate printer attribute file for your new physical printer by the printer model, because the names of printer attribute files have the format printer_model.paf. For example Digital_DEClaser5100_level2PS.paf is the printer attribute file for the Digital DEClaser5100 printer.

The paf files are stored in the /usr/pd/share/cap directory.

6.2.1    Creating Physical Printers

Use the pdcreate command to create a physical printer. The pdcreate command-line has the following syntax:

pdcreate -c printer [-x extended_attribute_string] [-X attribute_filename] printer_name

The attributes that need to be set when you create a physical printer include the following:

The printer attribute files include default values for the printer-model, printer-connection-level, and printer-tcpip-port-number attributes. You can include values for the other attributes when you create the physical printer, or you can set or modify the values after you create the printer.

6.2.1.1    Setting the Printer Address

The supervisor requires a unique value for the printer-address attribute for any printer connected to it. If this attribute does not have a value assigned to it, you cannot enable the physical printer.

Table 6-1 lists the general forms of the printer-address attribute that the supervisor recognizes. The forms indicate a serial, parallel, or IP network socket connection. IP network socket ports can be simple node names or addresses with or without dotted domain syntax, and with or without port numbers.

Table 6-1:  Printer Address Formats

Format Description Connection Method Supervisor
/dev/lp<n> Parallel port n Parallel pdspvr
/dev/tty<nn> Serial port nn Serial pdspvr
name[:port] Hostname (without domain) and port IP Socket pdspvr
name.dom[:port] Hostname with domain and port IP Socket pdspvr
address [:port] Numeric IP address and port IP Socket pdspvr
host, printer, extension Outbound gateway printer bsd pdspvlpr

Note

If you do not specify the port number, the supervisor derives it from the printer-tcpip-port-number attribute. If you specify the port number as part of printer-address, it supersedes the value of printer-tcpip-port-number, if any was specified.

6.2.1.2    Setting the Printer Connection Method

Printer hardware can be attached to a supervisor host in several ways. Desktop and mid range printers typically have one or more connectors on the back that allow them to be connected to their source of data such as a host, a terminal server, or a network. Such a connector, and the hardware it connects to, is called the printer interconnect.

For some printers, interconnects are hardware options that customers purchase separately, and are not always the same for a printer model. For other printers, the possible connections are known and fixed. Examples of physical interconnects include:

Some physical interconnects have variants, such as unidirectional and bidirectional. Some support link-layer protocols, such as TCP/IP, or session layer protocols such as bsd or lpd.

With the print system, the term connection methods refers to the set of ways in which the server process can communicate with the printer output device. The printer-connection-method attribute specifies the appropriate connection method to be used with the printer. The supported set of connection methods are:

One supervisor can support multiple output devices using several connection methods simultaneously.

If you do not specify the value of printer-connection-method, the pdspvr supervisor selects a value based on the following:

  1. If the value of printer-address is of the form /dev/lp<n>, then the connection method is parallel.

  2. If the value of printer-address is of the form /dev/tty<nn>, then the connection method is serial.

  3. If the value of printer-address is not /dev/something, then the connection method is ip-socket.

6.2.1.3    Setting Printer Connection Level

Some printers use more features that a connection offers than do others. For example, some printers provide status messages on a serial back channel while others do not. To provide support for a broad range of connection types, the print system uses the printer-connection-level attribute. The recognized values are 0 through 5, as listed in Table 6-2.

Table 6-2:  Printer Connection Level Values

Value Description
0 None specified. Use system default.
1 Output-only data (unidirectional). Printers that are unidirectional only cannot report conditions such as paper-out, jammed, or off-line to the supervisor process. The supervisor relies on flow control (if that is available) to prevent the flow of document data when the printer is powered down or unavailable.
2 Output-only data; status bits returned. Printers that report status in the form of status bits can supply the supervisor with some status information, such as when the printer is offline or when an engine error occurs.
3 Bidirectional, without synchronized session control. PostScript printers that exploit a bidirectional data connection send a wide variety of more detailed printer status messages to the host. The print system supervisor converts many such printer messages to events and problem text, which is available for display by clients.
4 Bidirectional, with synchronized session control. See note on PostScript printers for value 3.
5 DIGITAL PrintServer.

The printer attribute files provided with the print system software contain an appropriate connection level definition for each supported printer. Under normal circumstances, you should not need to change the value of the printer-connection-level attribute from its printer attribute file setting, because the printer and its interconnect typically define the level. However, use of terminal servers or other special purpose interfaces affect the level of support that the print system can provide and might require that you lower the connection level to get reliable, though less capable, support for a printer.

6.2.1.4    Setting Serial Port Parameter Attributes

Connecting a printer to a serial port requires that you specify several communications parameters. If you do not specify the attribute printer-baud-rate, the print system assumes that you have correctly set up the port in advance. If you do specify printer-baud-rate, the supervisor sets the other attributes to values you specified or to the values listed in Table 6-3, if the attributes are initially empty.

Table 6-3:  Serial Port Parameter Values

Attribute Values Default Value
printer-baud-rate 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 Uses the physical port settings.
printer-data-bits 5, 6, 7, 8 8
printer-stop-bits 0, 1, 2 1
printer-input-flow-control none, xoff, dtr xoff
printer-output-flow-control none, xoff, dtr xoff
printer-parity none, even, odd, mark, space none

6.2.1.5    Setting the TCP/IP Port Number

Connecting to a TCP/IP socket connection requires knowing the port number that the printer uses to communicate. The attribute printer-tcpip-port-number causes the supervisor to use the specified port number when connecting to a printer on an ip-socket connection.

If you specify the port number as part of the printer-address attribute, then that port number overrides the printer-tcpip-port-number attribute value. Printer attribute files include the printer-tcpip-port-number attribute whenever a printer has a prevailing network connection option, such as HP JetDirect printers.

Attribute Valid Values Default
printer-tcpip-port-number 1 - 65535 9100

6.2.1.6    Using Unsupported Printers

If your printer is not supported and a printer attribute file (PAF) is not supplied, and if you know the primary document format or the printer language of the printer device, use one of the generic files.

Generic PAF files are located in /usr/pd/share/cap for printers that accept PostScript, ANSI, PCL, and HP-GL data. The generic PAF files describe a minimal configuration with no options installed. Set the appropriate xxx-supported and xxx-ready attributes for options such as, duplex, additional input trays, output or finishing options, to make them available to users.

The generic files do not specify network port information. If the printer has a network connection, set the printer-connection-level, printer-connection-method, and printer-tcpip-port-number attributes and specify the printer-address. See Section 6.2.1.1for information on how to set the printer-address.

To create a physical printer without a printer attribute file, specify the printer-model with the pdcreate command:

# pdcreate -c printer -x printer-model='"XL9000"' my_sup:my_pp

The printer model name does not affect the way the physical printer object behaves.

Use the pdset command to specify the values for the following attributes:

native-document-formats-ready
document-formats-supported
document-formats-ready
printer-address
associated-queue

See the Advanced Printing Software Command Reference Guide for valid values and descriptions of the attributes.

6.2.2    Examples for Creating Physical Printers

The following examples show how to create physical printers:

6.2.3    Setting Optional Attributes for Physical Printers

A number of attributes can be set to fully utilize the capabilities of your printers and print system. These attributes enable use of features such as duplex printing, separator pages, number up, and so on.

The following examples show how to set some of the more common attributes:

6.2.4    Enabling a Physical Printer

When you enable a physical printer, the printer can accept print jobs from its associated queue.

Use the pdenable command to enable a physical printer. When you enable a physical printer:

The pdenable command has the following command-line syntax:

pdenable [-c class_name] [-mmessage_txt] [-x extended_attribute_string] [-X attribute_filename server_name printer_name]

Because printer is the default class for the pdenable command, you do not have to use the -c option to specify a class when you enable a printer.

The following examples who how to enable a physical printer:

6.2.5    Disabling a Physical Printer

Use the pddisable command to disable a physical printer. When you disable a physical printer, the printer will not accept new print jobs; however, any jobs currently printing or processing are completed.

When you disable a physical printer, the name of the printer is removed from the physical-printers-ready attribute on the supervisor, queue, and spooler.

The pddisable command has the following command-line syntax:

pddisable [-c printer] [-m message_txt] [-x extended_attribute_string] [-X attribute_filename server_name printer_name ]

The following example shows how to disable a physical printer lxk4039:

# pddisable lxk4039

6.2.6    Pausing a Physical Printer

Use the pdpause command to pause output on a physical printer. When you pause a physical printer:

If the printer is not printing when paused, it still requires a resume operation (pdresume) to start printing again.

The pdpause command has the following command-line syntax:

pdpause [-c class_name] [-m message_txt] [-x extended_attribute_string] [-X attribute_filename] [printer_name]

Because printer is the default class for the pdpause command, you do not have to use the -c option to specify a class when you enable a printer.

6.2.7    Resuming a Physical Printer

Use the pdresume command to resume operation of a printer that has been paused by the pdpause command. When you resume a printer, the printer resumes printing the currently assigned print job, if there is one, from the point where the job was paused.

The pdresume has the following command-line syntax:

pdresume [-c class_name] [-m message_txt] [-x extended_attribute_string] [-X attribute_filename printer_name]

The default class for this command is printer.

The following example shows how to restart the printer, hpcolorPS:

#  pdresume hpcolorPS

6.2.8    Deleting a Physical Printer Object

Use the pddelete command to delete a physical printer object.

Before you can delete a physical printer object, the printer must be disabled and all active jobs must be deleted.

The following attributes are updated when you delete a physical printer:

The pddelete command has the following command-line syntax:

pddelete [-c class_name] [-x extended_attribute_string] [-X attribute_filename printer_name]

The following example shows how to delete the printer, hpcolorPS:

# pddelete hpcolorPS

6.3    Creating and Managing Logical Printers

A logical printer object is an abstraction that indicates particular characteristics and capabilities of one or more physical printers. Users specify logical printers when they print jobs to direct their print data to a set of devices that can satisfy the job and document requirements.

Use the pdcreate command to create a logical printer and specify a spooler server as part of the operand as shown in the following command-line syntax statement:

pdcreate [-c printer] [-x extended_attribute_string] [-X attribute_filenamespooler_name: printer_name]

When you create a logical printer, the associated spooler:

The print system requires the name of the queue associated with the logical printer before you can enable the logical printer. Though you can set the corresponding associated-queue attribute subsequent to the object creation, the recommendation is to specify it with the pdcreate command.

If you specify the associated-queue attribute with the pdcreate command, the associated spooler updates the spooler logical-printers-supported attribute. If you specify associated-queue, the specified queue must exist or the operation fails.

You can also specify initial-value-job and initial-value-document objects to set job and document defaults for the logical printer with the printer-initial-value-job and printer-initial-value-document attributes. You can set the attributes with the pdcreate command or with the pdset command after the object creation.

6.3.1    Example for Creating a Logical Printer

The following example shows how to create the logical printer doc2 with the associated queue production_q on the spooler red_spl.

# pdcreate -c printer \
-x "associated-queue=production_q" red_spl:doc2

6.3.2    Setting Optional Logical Printer Attributes

A number of attributes can be set to realize the maximum capabilities of your printers. These attributes enable use of the features of your printers and can enable features such as duplex printing, separator pages, number up, and so on.

Note that these parameters are inherited from the attributes of the physical printer when the logical printer is enabled. If, before you enable the logical printer, you set the logical printer attributes to values different from those on the physical printer, then the physical printer attributes are not inherited.

6.3.3    Performing Management Functions on Logical Printers

The following sections describe the management functions that you can perform on logical printers in your print environment. These functions include:

6.3.3.1    Enabling a Logical Printer

Use the pdenable command to enable a logical printer. When you enable a logical printer:

The pdenable command has the following command-line syntax:

pdenable [-c printer] [-m message_txt] [-x extended_attribute_string] [-X attribute_filename printer_name]

The following example shows how to enable the logical printer log_printer_1 on the default server.

#pdenable log_printer_1

6.3.3.2    Disabling a Logical Printer

Use the pddisable command to disable a logical printer. When you disable a logical printer, new print job requests are not accepted and the name of the printer is removed from the logical-printers-ready attribute for the associated queue and spooler.

The pddisable command has the following command-line syntax:

pddisable [-c printer] [-m message_txt] [-x extended_attribute_string] [-X attribute_filename printer_name]

The following example shows how to use the pddisable command to disable a logical printer using no options:

# pddisable logical_printer_1

6.3.3.3    Listing Printer Attributes

Use the pdls command to display a list of the attributes of logical and physical printers. The pdls command has the following format command-line syntax:

pdls [-c class_name] [-f filter_txt] [-F] [-g] [-r requested_attribute] [-sstyle_name] [-x extended_attribute_string] [-X attribute_filename printer_name]

The following examples show how to use the pdls command and the output generated by the command.

6.3.3.4    Displaying Jobs Submitted to Logical Printers

Use the pdq command to generate a list of jobs that have been submitted to a logical printer. The command can be used to display one or all jobs currently residing in the queue associated with the printer. Jobs are displayed in the order in which they are scheduled to print. The following examples demonstrates the use of the pdq command:

6.3.3.5    Deleting a Logical Printer

Use the pddelete command to delete a logical printer. When you delete a logical printer, you should consider the following:

The syntax for the pddelete command is:

pddelete [-c printer] [-m message_txt] [-x extended_attribute_string] [-X attribute_filename printer_name]

The following command shows how to delete a logical printer printer_1:

# pddelete printer_1

6.4    Specifying Job Defaults and Creating Default Objects

Printing defaults specify attribute values that Advanced Printing Software applies automatically to jobs and documents, if the corresponding attributes are not part of the print request. The print system uses two classes of printing objects to identify sets of default attribute values. The object classes are:

The default values reflect capabilities of the physical printer that is the intended destination of a job. Therefore, you should first create the physical printer and set the desired printer attributes before creating the initial-value-job and initial-value-document objects.

Note that initial-value-job and initial-value-document objects are spooler objects, so the associated spooler should already exist before you can create the initial value objects.

6.4.1    Specifying Defaults for Jobs and Documents

You can create multiple initial-value-job and initial-value-document objects to specify different defaults for the same physical printer to account for the physical printer capabilities. How you apply the initial-value-job and initial-value-document objects determines which defaults the physical printer will use for the printed output.

To apply an initial-value-job or initial-value-document object, you need to do one or both of the following:

When you apply initial-value-job and initial-value-document objects to both a logical printer and a job, the objects specified with the job override the objects specified for the logical printer.

As the administrator, you determine how initial-value-job and initial-value-document objects should be applied:

The following example might help you determine applicable initial-value-job and initial-value-document objects for your site.

The initial-value-job object JobDefaults1 includes the job attribute job-sheets=job-copy-start so that when the print system applies JobDefaults1 the printed output includes start sheets for jobs. This might be the typical case and you might therefore associate JobDefaults1 to the relevant logical printer:

# pdset -c printer \-x 'printer-initial-value-job=JobDefault1' \
[spooler_name:]logical_printer_name

However, you might be aware that there would be times when start sheets might not be desired, so you create initial-value-job object JobDefaults2 with the attribute job-sheets=none. Because this might be a special case, you do not associate JobDefaults2 with the logical printer. Instead, users can apply JobDefaults2 during job submission:

# pdpr -x 'initial-value-job=JobDefaults2' file_name

Because JobDefaults2 becomes part of the job submission print request, it overrides JobDefaults1 associated with the logical printer.

This example focuses only on one attribute (job-sheets). The initial-value-job objects JobDefaults1 and JobDefaults2 can differ through more than one attribute.

6.4.2    Creating Default Objects

When you have determined the job and document defaults that you want for your site, you are ready to create the initial-value-job and initial-value-document objects.

Use the pdcreate command to create an initial-value-job and initial-value-document objects. The pdcreate command has the following format:

pdcreate [-c initial-value-job] spooler_name: iv-job-name

pdcreate [-c initial-value-document] [spooler_name: iv-doc-name]

The following examples show how to use the pdcreate command to create an initial-value-job and aninitial-value-document objects:

# pdcreate -c initial-value-job [spooler_name:]iv_job_name
# pdcreate -c initial-value-document [spooler_name:]iv_document_name

You must specify a spooler name if the object is not being created for your default server.

If you already know the job and document attributes that you want to include for the initial-value-job and initial-value-document objects, you can include -x 'attribute_name=attribute_value' with the pdcreate command.

The pdprintadmin GUI application provides access to the default settings of a logical printer. You can create initial-value-job and initial-value-document objects through the default settings if the logical printer does not already have initial-value-job and initial-value-document objects applied to it.

The initial-value-job and initial-value-document objects have two sets of attributes:

Use the pdset command to set attributes for initial-value-job and initial-value-document objects:

#pdset -c initial-value-job \
-x attribute_name=attribute_value iv_job_name

#pdset -c initial-value-document \
-x attribute_name=attribute_value iv_document_name

6.4.3    Creating Printer Setup Modules

Sometimes a form requires a printer to print text in a specific font size or printer mode. A printer setup module is a file that the supervisor prepends to the document stream when printing. The command sequences in the module select the printing mode or format that you want. Refer to the printer's programming documentation to find the escape sequences required and add them to a printer setup module.

To create a printer setup module:

  1. Create the printer setup file in a user directory.

  2. Create a new directory and copy the printer setup file into it. For example, /usr/local/pd/setup.

  3. Set the cfg-prologue-path attribute on the supervisor to indicate where the setup file is stored:

    # pdset -c server -x cfg-prologue-path=/usr/local/pd/setup my_sup