Printing processes

When you print a file, the system sends codes to the printer. Some codes print specific characters, such as specific alphabetic or numeric characters. Other codes control how characters or files are printed, such as by underscoring certain characteristics or by adjusting the page length.

If you want to send different character codes to the printer, such as changing the word that to this, you do not have to understand the underlying codes; you merely edit the file.

To alter the way a printer works, however, you must understand what happens when you print a file, which options you have for sending control information to the printer, and which printer characteristics you can control.

You can use the System Manager Interface Tool (SMIT), or the qprt command to send a file to a printer. In addition, you can use SMIT to cancel or prioritize a print job.

Whichever method you use to print, a file never goes directly to the printer. All three methods first must call the enq command to place the print request in a queue. The print request stays in the queue until a printer becomes available, at which point the qdaemon command runs the (printer input/output backend) piobe command. The piobe command processes the file and sends it, along with control information, to the printer. The printer then receives a data stream containing the contents of the file and the control information specified with the qprt command.

You can add printer control information to the printer data stream in the following ways:
  • Include printer control codes in the file.

    To do this, set the print queue data stream to passthru (that is, d=p). For more information, see Printer colon file conventions.

    Include all printer control information that is unique to that file. For example, to underscore the title of a book or print a paragraph in bold type, insert codes that start and stop the printer control information at the correct places.

    Some application programs, such as word processors, allow you to insert specific printer controls in the file. However, if the printer cannot be configured from the application program, you must use a system editor to insert printer control codes. Printer control codes are available with the printer, from the dealer where the printer was purchased, or from the printer manufacturer.

  • Supply command flags with the qprt command.
    You can specify particular print characteristics for a single print job. For example, the qprt command flag for setting pitch is -p Number, where Number is the number of characters per inch. If the standard qprt command setting is 10 characters per inch, but you need 12 characters per inch for the printtest file, type the command:
    qprt -p 12 printtest

    The flag on the command line overrides the standard qprt command setting for this job. The standard qprt command pitch setting remains 10.

  • Change the standard qprt command settings.

    You can use SMIT or the lsvirprt command.

    Note: You must have root authority or be a member of the printq group.

    For example, to change the standard pitch to 12 characters per inch, run the chvirprt command, or SMIT. Select the printer from the list displayed and type the attribute name and value, separated by the equal sign (=).

    The attribute names for the qprt command flags are the flag letters. You can change the standard pitch to 12 by specifying p=12.