Printer Setup On AIX and UNIX ngaix.gif (1051 bytes)nghp_ux.gif (428 bytes)

To direct the output of of VisualAge for Java printing commands to a printer, you must first configure the system to recognize any available printers and queues.  Printer definitions are installed through the Print Setup option in the File menu.  To install printer definitions:

  1. Open the Print Setup dialog by selecting Print Setup from the Workbench File menu.
  2. When the dialog opens, select Install.  A Printer Installation dialog will appear, listing any configured printers.  This list should contain one installed printer, which may be used as an example.  After installing any additional printers, this printer can be deleted.
  3. To install a new printer, select Add Printer.  A dialog appears, listing the available printer types and currently configured ports.  A connection to a printer is specified by a combination of a PostScript printer definition (PPD) and a port definition.
  4. Select Define New Port to create a new port definition.  A dialog appears, allowing you to edit port definitions.  Type the port definition in the Edit Port input area.  Port definitions have the following format:
    port=print_command

    The port is any string which users will recognize as referring to a particular printer.  The print_command is the command used for sending output to the printer port (for example, lp -d or lpr -P).   For example, suppose you have two printers, ADMIN and LAB.  Your definitions might look like the following:

    ADMIN=rsh bandit "lp -d ps"
    LAB=lpr -Pgonzo

    In this example, ADMIN refers to a printer connected to the system BANDIT, so the print command is a remote shell command executed on BANDIT.  ADMIN is a PostScript printer attached to a queue named PD, so the command lp -d ps is executed on BANDIT to print to ADMIN.  LAB, however, prints to a printer on the local system, so the print command executed locally to print to LAB is lpr -Pgonzo, where GONZO specifies the defined PostScript printer queue name.

    Note: Some systems use lp -dqueuename to send output to the printer; others use lpr -Pqueuename.  Use the appropriate command to generate printed output on your system.

  5. Select Add/Replace to add the new port in the list of current port definitions.
  6. Repeat for each printer you want to sent output to.

    Note:  To modify an existing port using the Printer Setup dialog, select the port you want to modify and edit the port information in the Edit Port input area, then select Add/Replace.

  7. In the Printer Devices field, select the description that matches the printer you are installing.  If no description matches your printer, contact your printer vendor for a PPD file.
  8. Select  the desired port in the Current Port Definitions list box and select Add Selected.  The new printer is now included in the list of currently installed printers.

To close any dialog without accepting the changes, select Cancel.   To close a dialog and accept the changes, select Dismiss.

Configuring Printer Setup Options
The Print Setup dialog does the following:

The orientation, scale, and number of copies to be printed can be specified directly using this dialog.  Additionally, the action area of the Print Setup dialog contains the following buttons:

Button Description
Apply Provides changed configuration information to the application without updating the default printer.
Save Saves the current configuration information as your default printer.
Reset Reloads the default configuration from $HOME/.Xpdefaults
Cancel Closes the dialog and aborts all configuration changes.
Options Displays the options dialog box that allows you to select a different printer setup.
Install Displays the installation dialog box that allows you to add or remove printer devices and printer ports.

Selecting the Install button will open a dialog allowing you to add and remove printer definitions.

To select a different printer or to change printer-specific properties, select Options. If the Options button is disabled, ensure that Printer Specific is selected in the outputTo: field.

Printer name, resolution, page size, and paper tray can be changed using this dialog.   Selecting the arrow button to the right of the field displays a list of valid values from which you can choose.  The values presented differ based upon the particular printer selected.  To save the configuration as the default, after you have changes the printer option, select Save.  Select Apply when finished to close the printer prompter.

Printer Configuration Information
By default, printer configuration information is stored in the file Xpdefaults, in the printer subdirectory (that is opt/IBMVJava/printing).  The information in this file is used by the printer prompter to allow selecting and modification of currently defined printers.  This file can be treated as common and shared by multiple users.

It is important, however, to note that the Xpdefaults file is read-only.  When a user modifies the printer information in this file using the printer prompter, the resulting information is stored in the user's home directory in the file .Xpdefaults.   If a user's home directory contains an .Xpdefaults, this file will always be used in preference to the common Xpdefaults file.  Each user, therefore, can have a different printer configuration.  As a result, it is necessary to rename the $HOME/.Xpdefaults file to Xpdefaults and move the file to the printing directory for all users to have access to the newly installed printers.

ngrelt.gif (466 bytes)
Printing Program Elements
Printing Source Code and Other Text
Printing the Graph View of a Class