11.2.3 Controlling the lpd Daemon

11.3 Virtual Printers

Virtual printers are unique to AIX, but have a heritage in UNIX called printcap files. They basically add commands to setup a printer to perform certain operations and then provide simple formatting for ASCII text. They are not an API. They are a set of attributes that control what gets sent to the printer as setup commands before and after the print job. Virtual printers also do simple text formatting like adding carriage returns to line feeds.

11.3.1 Files Used with Virtual Printers

The following files are important when looking at virtual printers:

/usr/sbin/mkvirprt
Contains the mkvirprt command.
/etc/qconfig
Contains configuration files.
/usr/lib/lpd/pio/predef/*
Contains predefined printer attribute files.
/var/spool/lpd/pio/@local/custom/*
Contains customized virtual printer attribute files.
/usr/lib/lpd/pio/etc/*.attach
Contains attachment type files.
/usr/lib/lpd/pio/etc/*.config
Contains the configuration file for the printer.
/var/spool/lpd/pio/@local/ddi*
Contains digested virtual printer attribute files.

11.3.2 Key Commands

Some of the virtual printer commands are:

smitty mkpq
Command to add a virtual printer. Also adds printer device.
smitty chpq
Command to change a virtual printer.
smitty rmpq
Command to remove a virtual printer.
lsvirprt
Command to change individual attributes of virtual printer. Also used to list all attributes of a virtual printer.
smitty chvirprt
Change a virtual printer attribute.

Note

Virtual Printers do not support graphics except to pass it through to a printer.

A virtual printer is actually a fairly simple interface to a printer. It basically performs these functions:

  1. Initializes the printer.

  2. Provides a hook or interface to filters.

  3. Formats ASCII data.

  4. Translates from the input code page to the output printer symbol set. (ASCII only)

  5. Resets the printer to a predefined condition.

  6. Calls the program to send the header and trailer pages.

  7. Sends a form feed at the end of job.

Virtual Printers do not:

  1. Generate any printer language commands such as PostScript or PCL, other than the initialization and reset sequences.

  2. Test for correctness of the format of data.

  3. Automatically recognize the type of data except for very simple sniffing of the first couple of characters if set up properly.

So basically the virtual printer does almost nothing for any formatted PCL, formatted PPDS, graphics, or PostScript data except tell the printer what language is coming at it.

11.3.3 Creating a Virtual Printer

A virtual printer can be created using the mkvirprt command in AIX 3.2.5 or using the System Management Interface Tools (SMIT) fast path smitty mkpq in AIX Version 4. For this discussion, AIX Version 4 commands are used.

11.3.3.1 Using the smitty mkpq Command

The command smitty mkpq produces a screen similar to that shown in Figure 106.



Figure 106: SMIT mkpq Command Screen

Perform the following steps:

  1. Select attachment type remote, as not highlighted in Figure 106.

  2. Select your preferred Type of Remote Printing. For this illustration it is Standard processing.

  3. Fill in the characteristics for the virtual printer being created as shown in Figure 107 and press the Enter key. After the Command: OK returns, exit SMIT and complete the process.



    Figure 107: Adding a Standard Remote Print Queue

You will now use the lsvirprt command to list the virtual printers on the system. The command lsvirprt without flags produces a menu as in Figure 108, from which you can view and change the attributes of the virtual printer.



Figure 108: lsvirprt Command Output Screen

Using the smitty chvirprt command, change attributes of the virtual printer. This command produces the screen in Figure 109. From this screen you can supply the virtual printer queue, in this case virprt1, and then proceed to change the desired attributes for the virtual printer.



Figure 109: SMIT chvirprt Command Screen

11.4 Troubleshooting Remote Printing Problems