# Configuring and Administering Printing from the Desktop

There are a variety of ways a desktop user can print files. They fall into two major categories: printing from the desktop and printing from an application.

Ways to print from the desktop include:

- Selecting a file in File Manager and choosing Print from the Selected menu or the icon's pop-up menu

- Dragging a file from File Manager to the Front Panel Printer control or the Personal Printers subpanel

- Dragging a file from File Manager to a printer in the Print Manager main window

  To print from an application, use the Print command, usually accessed from a menu or other control within the application's window.

  SAG.PrCnf.div.2
  SAG.PrCnf.div.6
  SAG.PrCnf.div.9
  SAG.PrCnf.div.11

## Adding and Deleting Printers

This section contains the procedures for adding and deleting printers from the desktop.

### To Add a Printer to the Desktop

1. Add a printer to your system's configuration.

   Follow the instructions in the system administration documentation for your operating system.

2. Run the command:

       env LANG=language /usr/dt/bin/dtprintinfo -populate

   Note that you must have super-user permission to run this command.

3. Restart Print Manager or double-click Reload Actions from the Desktop_Tools application group in Application Manager. Verify that the printer shows up.

4. Send mail to your users to let them know they should also restart Print Manager or run Reload Actions.

Each time it is invoked,
Print Manager reads the system printers configuration list. If it detects a new printer, it automatically creates a new desktop printer action and icon for that printer. You don't need to do anything else to make the printer appear on the desktop.

### To Delete a Printer from the Desktop

1. Remove the printer from your system's configuration.

   Follow the instructions in the system administration documentation for your operating system.

2. Restart Print Manager or double-click Reload Actions from the Desktop_Tools application group in Application Manager. Verify that the printer is gone.

3. Send mail to your users to let them know they should also restart Print Manager or run Reload Actions.

Each time it is invoked, Print Manager reads the system printers configuration list. If it sees that a printer has been removed from the list, it automatically removes that printer's action and icon from Print Manager and File Manager. You don't need to do anything else to delete the printer from the desktop.

Print Manager cannot remove printers from the Front Panel. Therefore, whenever you remove a printer from your configuration, you should send mail to all users on the system telling them to remove any icons of the deleted printer from the Front Panel.

### Modifying the Job Update Interval

To change how often the information displayed in
Print Manager is updated, modify the job update interval. By default, Print Manager queries printers every thirty seconds for information on their print jobs. You can change how often Print Manager queries the printers by using the Update Interval slider in the Set Options dialog box (displayed by choosing Set Options from the View menu).

## Printer Icon Images

When you add a printer, it is automatically assigned the default printer icon. If you have another icon you want to make available for it, place the icon files in `/etc/dt/appconfig/icons/`language, or in some other directory along the icon search path. Users can then select this icon to replace the default icon for the printer.

You must create a complete set (large, medium, and tiny) of the icons or they will not show up in the icon selector in Print Manager.

For more information about the icon search path, see SAG.Datab.div.20.

### Icon File Names and Sizes

Icon file-naming requirements are:

    base_name.size.type

where:

size | `l` (large), `m` (medium), `t` (tiny). For more information about icon sizes, see SAG.CrIcn.div.5.
type | `pm` (color pixmap), `bm` (bitmap).

For example, icon file names for medium and tiny pixmap icons for a color printer might be `ColorPrinter.m.pm` and `ColorPrinter.t.pm`.

Refer to SAG.CrIcn.div.1 for more information on creating icons.

### To Globally Change the Icon, Printer Label, or Description of a Printer

You should change global printer properties as soon as you add the printer, before users have modified it using Print Manager. Once a user has modified the printer properties using Print Manager, they will not see the changes you make.

Edit the file `/etc/dt/appconfig/types/`language`/`printer_queue_name`.dt` with the desired information for the icon, printer label, or description:

1. In the `ICON` field, update basename to the new icon base name.

2. In the `LABEL` field, update labelname to the new label for the printer.

3. Update the text in the `DESCRIPTION` field.

   This is a good place to put the location of the printer, type of printer, and printer contact. To add more than one line, put a `\` at the end of the line. For example:

    DESCRIPTION    This is a PostScript Printer in Building 1\
                   Room 123. Call 555-5555 for problems.

## Configuring the Default Printer

The default printer is accessed when the user:

- Drops an object on the Front Panel Printer control

- Selects an object in File Manager and chooses Print from the Selected menu or the icon's pop-up menu

- Prints from applications that use the default printer

### To Change the Destination for Default Printing

To change the default printer for all users:

1. Open the file `/etc/dt/config/Xsession.d/0010.dtpaths`.

   If `/etc/dt/config/Xsession.d/0010.dtpaths` does not exist, copy it from `/usr/dt/config/Xsession.``d/0010.dtpaths`

2. In the `LPDEST=`printer line, update printer to the new destination for default printing.

   If the line does not exist, add a line `LPDEST=`printer, where printer is the name of the printer you want to be your default printer.

3. Users need to log out and back in.

To change the default printer for a single user, that user should:

1. Copy another printer to the Front Panel from the Personal Printers subpanel.

To designate a different printer as the default printer:

1. Go to your home folder and open the file `.dtprofile`.

2. Add or edit a line that sets a value for the LPDEST environment variable:

       LPDEST=printer_device; export LPDEST

   If you are using `csh`, the syntax is:

       :setenv LPDEST printer_device

   For example, the following line would change the default printer to the printer whose device name is `laser3d`.

       LPDEST=laser3d; export LPDEST

   If you are using `csh` the syntax is:

       setenv LPDEST laser3d

## Printing Concepts

Users can invoke printing either by dragging an object, whether it be a file icon or a text selection, onto the printer icon and dropping it there. Alternatively, users can invoke printing by selecting a print command in an application. In each case, the printing proceeds differently.

### Printing By Drag and Drop Invocation

When a print request is initiated by dropping a file or a text selection on a printer control, the system proceeds as follows:

1. The system searches the data-type database for the definition of the object dropped.

2. If there is a unique print action for the data type (specified using the ARG_TYPE field in the print action), it is used. If no unique print action for the data type is found, the default print action uses `dtlp` to print the object. For example, if the file is a PostScript. file, the system uses the Print action for PostScript files. (This action is defined in `/usr/dt/appconfig/types/<language>/dt.dt`.) If you used the Create Action tool for this data type, the print command you entered is the unique print action that will be used to print files with this data type.

3. The file is ultimately delivered to the printer using the normal UNIX `lp` printing subsystem.

### Printing From CDE Applications

A number of the CDE applications, including the Calendar Manager (`dtcm`), the Help Manager (`dthelp`), the Mailer (`dtmail`), and the Text Editor (`dtpad`) have built-in support for printing. These applications rely on the services of the X Print Server to accomplish their printing. The X Print Server is simply a normal (video) X Server which has been enhanced to produce output for various types of printers including raster, PCL, and Post Script.

When a print request is initiated from inside a CDE application (for example by selecting the "Print ..." command from the File menu in the Text Editor), the following happens:

1. The application displays a dialog allowing the user to set generic, application specific, or printer specific printing options.

2. The application sends instructions to the X Print Server. The instructions include standard X drawing requests enhanced by page and job boundary indicators.

3. The X Print Server translates the instructions into output appropriate to the target printer. The particular output produced depends upon the capablilities of the X Print Server and the target printer selected.

4. The X Print Server delivers the print output to the printer using the normal UNIX `lp` printing subsystem.

#### To Support Printing From CDE Applications

In addition to the application and the X Print Server, two programs are required to support printing from CDE applications: the Print Dialog Manager (PDM) and the PDM daemon.

Displaying and setting printer-specific printing options are handled in special programs called Print Dialog Managers (PDMs). Each class of printer has its own PDM, which knows about the specific set of options and capabilities that it offers.

A second class of programs called PDM daemons handle the tasks of recognizing the fact that an application wants to display or set printer-specific printing options and starting the correct PDM for the selected printer.

In summary, for printing from CDE applications to proceed successfully you must:

1. Make sure that the printers are added correctly to your system's configuration.

2. Make sure that the correctly configured X Print Servers needed to support your printer configuration are running. The default X Print Server for CDE is `Xprt`.

3. Make sure that the correctly configured Print Dialog Manager (PDM) daemons needed to support your printer configuration are running. The default PDM daemon for CDE is `dtpdmd`.

4. Make sure that the correctly configured Print Dialog Managers (PDMs) needed to support your printer configuration are available. The default PDM for CDE is `dtpdm`.