Setting up a printer

To set up a printer to print DataWindow objects, you must add access to the printer, set up the dwprint.ini configuration file, and create an XPPATH environment variable.

Adding access to the printer

As the root user, add access to the printer on Solaris using the Solaris admintool utility. For more information, see the Solaris documentation.

Setting up dwprint.ini

The dwprint.ini file in the $EAServer/bin directory is the configuration file for DataWindow printing. It closely follows the Microsoft Windows approach to printer configuration. As a result, it includes [windows], [devices], and [ports] sections where you must provide appropriate entries for your printers.

You usually do not need to modify other sections in this file. However, some problems can be resolved by adding or changing other sections. For example, you can try adding an entry like the following to the [intl] section to change a date format:

[intl]
sShortDate=m/d/yyyy //Set the year to 4 digit.

Specifying ports

Each line in the [ports] section of dwprint.ini contains a user-defined port name and an associated command that is used to spool the output file. For example, the command to send a print job to a printer called myprinter connected directly to your system is:

lp -s -d myprinter -t$XPDOCNAME

$XPDOCNAME represents the name of the output file sent to the printer. The -s option suppresses the display of messages sent from lp in the EAServer Server console.

The following is an example of the [ports] section of the dwprint.ini file with two ports defined for remote printers called prnt1 and prnt2, one for a local printer, and an entry for printing to a file. The name of the output file is enclosed in quotes. This enables file names with multiple words to be used. The quotes must be escaped for remote servers because rsh strips them out:

[ports]
colorpr1=rsh prntsvr lp -s -d prnt1 -t\"$XPDOCNAME\"
colorpr2=rsh prntsvr lp -s -d prnt2 -t\"$XPDOCNAME\"
LOCAL=lp -d myprinter -t"$XPDOCNAME"
FILE: =

Matching a printer type to a defined port

The [devices] section contains a list of all currently configured printers. Each line contains a user-defined alias for the printer and three arguments: the printer model, the printer mode (PCL4, PCL5, or PostScript), and one or more ports to which the printer is connected.

The printer model is the name of the printer description file (PPD) used by the printer. PPD files are installed in the dwprinter/ppds directory in your PBVM installation. The text file filename_map.txt in that directory maps the name of the file that contains the printer description to the type of printer. For example, these are the mappings for the color_lj model used in the rest of the examples:

color_lj.pcl:"HP Color LaserJet PCL Cartridge"
color_lj.ps:“HP Color LaserJet PS"

The printer model and mode are separated by a space. The mode and port are separated by a comma. For example, for the first device specified in the following [devices] section, the alias is HP Color LaserJet PS, the model is color_lj, the mode is PostScript, and two ports are specified: FILE: and colorpr1.

[devices]
HP Color LaserJet PS=color_lj PostScript,FILE:,colorpr1
HP Color LaserJet PS=color_lj PCL5,colorpr2
HP Color LaserJet PS=color_lj PostScript,LOCAL
HP LaserJet PS=NULL PostScript,FILE:
HP LaserJet PCL=NULL PCL,FILE:

Specifying a default printer

The [windows] section contains default printer information. Like the ports specification, each device line has three arguments: the name of the PPD file, the driver, and the port, but in the [windows] section they are all separated by commas.

The following example shows a default entry for printing to a file (when the printer file description is set to NULL) as well as two other entries. The semicolon at the beginning of two of the lines is a comment character, so the current default printer is the HP Color LaserJet printer on the port colorpr1.

[windows]
device=color_lj,PostScript,colorpr1
;device=color_lj,PostScript,colorpr2
;device=NULL,PostScript,FILE:

Setting printer options

The dwprint.ini file must contain a configuration section for each model you have defined in the [windows], [devices], and [ports] sections. The configuration section provides default setup information for the printer, including the number of copies, orientation, page size, and DPI.

For example, for the color_lj printer used in the preceding examples, add configuration sections like this:

[color_lj,PostScript]
Filename=jaguar.ps
Scale=1.00
Copies=1
Orientation=Portrait
PageSize=Letter
DPI=300

[color_lj,PCL5]
Filename=jaguar.pcl
Scale=1.00
Copies=1
Orientation=Portrait
PageSize=Letter
DPI=300

Setting the XPPATH environment variable

Before you start a print job, set the XPPATH environment variable. The XPPATH variable must contain the path to a directory that includes printer description files and printer-specific font mapping files. This information is installed in the dwprinter directory in your PBVM installation.

For a C shell, set the path as follows:

setenv XPPATH $EAServer/dwprinter

For a Korn shell or a Bourne shell, set the path as follows:

XPPATH = $EAServer/dwprinter;export XPPATH