10.4 Printer-Related Files

This section explains the different printing related files. It gives an overview of these files and also provides information for editing these files for common printing needs.

10.4.1 Overview of Files

Table 10-2 lists files used by Oracle Reports for printing on UNIX.

Table 10-2 Printer-Related Files Overview

File Name/Extension Description


PostScript Printer Definition file


HP glue file


Adobe font metrics file


PCL font metrics file


font aliasing file


printer configuration file

10.4.2 PPD Files

PostScript is Adobe's page description programming language. PPD files define what capabilities a printer has for applications like Oracle Reports. For example, a PPD file might define which paper tray to use, what paper sizes are available, what is the physical dimension of the paper, and what font is available. Currently, Oracle Reports reads the paper sizes and fonts available on the printer as well as its default resolution from this file. In the future, more information may be used, such as memory for proper image partitioning.

The only reason to modify the PPD file is to allow Oracle Reports to recognize newly added fonts or memory. You can also change the DefaultPageSize to your preferred page size.


Page sizes, like all PPD entries, are case sensitive. Other entries in the PPD file should generally be left undisturbed.

When you select a printer that is not listed in uiprint.txt or change the type of printer to a PostScript type in the Choose Printer dialog box, you are prompted for the PPD file for the printer. You must choose the PPD file for a printer that most closely resembles the printer being used. PPD file names typically bear some resemblance to the printer model name.

In uiprint.txt, a PPD file must be specified for each printer. If an invalid PPD file is specified for the current printer (for example, no PPD file is found or the PPD file format is wrong), Oracle Reports will use default.ppd for that printer. You should make default.ppd a copy of another PPD file that better reflects the most likely default, local printer.

Oracle Reports includes a common set of PPD files, but sometimes you may need to get specific PPD files for your printers from the vendor. Table 10-3 shows some examples of PPD files that are shipped with Oracle Reports:

Table 10-3 Common PPD Files Shipped with Oracle Reports

PPD File Name Corresponding Printer


Apple LaserWriter v23.0


Dataproducts LZR-2665


Digital PrintServer 40


Default Level 1 PostScript Printer


HP LaserJet 4/4M PostScript 600DPI


Apple LaserWriter II NTX


NEC Colormate PS/80


Tektronix Phaser III PXi v2011.108


Linotronic 530


Default PPD file to be used when a printer is not available on UNIX.

If you need a PPD file that is not among those shipped with Oracle Reports, you must do one of the following (in order of preference):

  • Ask the printer vendor for the PPD file.

  • Download the PPD file from Adobe's Web site.

  • Copy an existing PPD file and edit it.

  • Ask Adobe for the PPD specs and write the PPD file.

The PostScript file only has the font information not the font metrics. Oracle Reports refers to the AFM file installed for the font metrics information. The font vendors provide these AFM files. Oracle Reports ships AFM files for some of the most commonly used fonts. The printer must have the required font installed in order to correctly print the PostScript file generated by Oracle Reports. Local Customization of PPD files

A PPD file is a static representation of the features of a printer. It contains default factory settings. Once a printer is installed, features such as additional memory, paper trays, and fonts may be added to the device. The task of managing a device is a dynamic issue that requires keeping track of fonts downloaded to disk, error handlers, RAM-based fonts and procedure sets, default device setup, and so forth. This kind of device management is beyond the scope of PPD files. However, there are some provisions for customizing the information contained in PPD files to adapt them to local instances of printers or to specific applications when necessary.

Instead of modifying the original PPD file, another approach would be having a new file having the local customization of certain parameters and refer to the primary file for the remaining information. The local customization file must contain a reference to the primary PPD file in this format:

*Include: "filename"

where filename is the name of the primary PPD file. This referencing allows a system administrator to later replace the primary PPD file without forcing users to edit their local customization files. A file referenced by the *Include keyword is treated as though it were in the including (local customization) file.

For example, suppose that the default.ppd file is defined as:

*PPD-Adobe: "4.0"
*Include: "datap462.ppd"

*% Page definitions
*DefaultPageSize: Letter
*DefaultPageRegion: Letter

The primary PPD file is datap462.ppd.

Administrators should change the name of the included file to conform to their site's default printer type.

When a local customization file includes a primary PPD file, there might be several instances of the same keyword in the composite file. Hence, the location of the primary file in the customization file (beginning or end) is important and effects the changes made by the customization file.

10.4.3 HPD Files

HPD files provide functionality for PCL printers that is similar to what PPD files provide for PostScript printers. HPD or HP glue files provide information on what fonts are available for a PCL printer. The HPD file format can be found in the HP PCL5 Developer's Guide.

Just as PostScript has AFM files, every HP font must have an associated TFM file. The font vendor should provide TFM files and new fonts should be added to the HPD file for your printer when installed. For a new font, you should specify the following fields in the HPD file:



fontname is a descriptive name for the font.

tfm-filename is the base file name for the TFM file.

If the TFM file isn't specific enough, you can also specify the following after the FONT field:

/ptsize={size {size ...}}

If the specified font is a bit mapped font but is listed in the TFM file as a scalable font, you can limit the point sizes used by listing the acceptable sizes as follows:

/symset={symset {symset ...}}

This field limits the supported symbol sets to those listed. See the HP PCL documentation for a list of recognized symbol sets.

Oracle Reports also supports the defaultpaper field for printing to PCL format. This field can be used to set the defaultpaper to be used by the Toolkit. The format of this field is:


For example, the following sets the paper name to A4:


The paper name is case insensitive. If you specify defaultpaper in more than one place, then the last instance of defaultpaper is used. If you specify a paper name that is not supported by the printer, defaultpaper is ignored and LETTER is used as the paper name instead. Similarly, if the paper name is incorrect, then LETTER is used.

10.4.4 Font Metrics Files

Oracle Reports supports two kinds of font metrics files: AFM files

Each AFM files contains the font-related metrics for a single font. The metrics include various font attributes such as style, weight, width, and character set. AFM files and a description of the AFM file format are typically available from the font or printer vendors.

To install the AFM file, just copy it to the AFM file location, which is listed in Section 10.2.2, "Verifying the Printer Setup for Oracle Reports". The name of the file must match name of the font without the.afm extension. For example, if the font name is CodedreineunBold, the file name must be CodedreineunBold.

To verify the font name, you can look for the fontname string in the AFM file. Please note that the AFM files are not font files, they are metrics files, which give information on how to properly format the characters for the printer. If you have an AFM file for a font, but the font is not present on the printer, Oracle Reports cannot generate the correct output on the printer because of the font metrics mismatch. You must ensure that the font used to design the report is also available on the printer. TFM files

PCL uses HPD and TFM files. The HPD file contains the list of available fonts for the printer and each font refers to a TFM file. TFM files serve the same purpose as Adobe's AFM files, with each file listing information about a single font. The HPD file is an ASCII file, which can be edited, but the TFM file is a binary file, which cannot be edited.

To use a new font in Oracle Reports and have it appear correctly in PCL output, you need the HPD and TFM files for the printer. You can copy an HPD file from an existing one, after you ensure it is suitable for your printer. The fonts specified in the HPD file must be available on the printer.

Oracle Reports includes a common set of TFM files. If you need other font metrics files for your printer, you should obtain them from your font or printer vendor. To install the TFM file, just copy it to the TFM file location, which is listed in Section 10.2.2, "Verifying the Printer Setup for Oracle Reports".

10.4.5 uifont.ali

The uifont.ali file defines the font aliases used by Oracle Reports. It is an extremely useful tool for cross-platform development because it enables you to define which fonts to substitute when a particular font is unavailable. uifont.ali is located in:

On Windows: ORACLE_INSTANCE\config\FRComponent\frcommon\tools\common

On UNIX: ORACLE_INSTANCE/config/FRComponent/frcommon/guicommon/tk/admin

To alias a font, use the following syntax:

source_font = destination_font

For each font, you may also specify the following attributes:


Styles may also be combined using a plus sign + to delimit the styles. For example:

Arial.Italic+Overstrike = Helvetica.12.Italic.Bold

This entry maps any Arial font that has both Italic and Overstrike styles to a 12-point, bold, and italic Helvetica font. Font faces can be case sensitive depending on the platform and the surface; that is, printer or system.

See Also:

Chapter 9, "Managing Fonts in Oracle Reports" for more font-related information.

10.4.6 uiprint.txt

uiprint.txt provides a convenient way for you to provide details about the printer queue, such as the type of printer driver and the printer description. You should edit uiprint.txt for each instance of Oracle Reports.

See Also:

Section 10.3.1, "Editing uiprint.txt File" for more information about uiprint.txt.

10.4.7 Editing the Printer-Related Files

This section describes how to edit the various print-related files: Editing PPD files

In some cases, you may need to change certain attributes in your PPD file. The sections that follow describe some of the attributes that you would commonly want to change: Changing the default paper size

Suppose that you need the page size to be A4 for some of your reports. On UNIX platforms, the printer driver is specified in uiprint.txt and the default page size is not necessarily set to A4. For example, hpljet41.ppd has LETTER as the default page size. Note that the default page size setting for each printer queue is taken from the corresponding PPD file.

To set A4 as the default page size, you would do the following:

  1. Edit uiprint.txt to include a PostScript Printer Description file (extension is .ppd) that supports the A4 page size. For example, you might include hpljet41.ppd.

  2. As a backup, make a copy of hpljet41.ppd.

  3. Add an entry to uiprint.txt:

    Printer_name: PostScript:1: the printer on floor1:hpljet41.ppd
  4. Edit hpljet41.ppd and change these settings as follows:

    DefaultPageSize: A4
    DefaultPageRegion: A4
    DefaultImageableArea: A4
    DefaultPaperDimension: A4 Changing the printer margin settings

To change the margins, you must modify the ImageableArea section in the PPD file. ImageableArea provides the bounding box of the area in which the printer may print for the page size named mediaOption. There will be one statement for each named page size supported by the device. *DefaultImageableArea provides the mediaOption name of the default imageable area. Since there can be only one default page size, this value should be the same as the value of *DefaultPageSize, *DefaultPageRegion, and *DefaultPaperDimension.

The syntax for defining imageable area is as follows:

*ImageableArea mediaOption: "llx lly urx ury "
*DefaultImageableArea: mediaOption | Unknown

ll stands for lower left corner and ur for upper right corner. The bounding box value of *ImageableArea is given as four real numbers, representing the x and y coordinates of the lower left and upper right corners of the region, respectively, in the PostScript language default user space coordinate system. The x and y axes of a given page size correspond to the x and y axes of that page size in the *PaperDimension entry.

The imageable area is defined as the part of the page where the printer may actually make marks. On some printers, the imageable area of a given page size varies as a result of the current resolution, amount of memory, the direction of paper feed, and other factors. In PPD files where the imageable area of a given page size can vary, the imageable area recorded for that page size will be the intersection of all possible imageable areas for that page size. This formula ensures that the available imageable area is never smaller than that shown in the PPD file and all marks made within the imageable area will be visible. It does, however, also mean that the imageable area in the current configuration might actually be larger than the imageable area shown in the PPD file.

The following table contains the option keywords currently registered for mediaOption, which designates a given page size on a device:

Table 10-4 mediaOption Keywords

mediaOption (Paper Size) Size (pts) Size (mm) Size (inches)


612 * 792

215.9 * 279.4

8.5 * 11


612 * 1008

215.9 * 355.6

8.5 * 14


1224 * 792

431.8 * 279.4

17 * 11


792 * 1224

279.4 * 431.8

11 * 17


842 * 1191

297 * 420

11.69 * 16.54


595 * 842

210 * 297

8.27 * 11.69


420 * 595

148 * 210

5.83 * 8.27


729 * 1032

257 * 364

10.12 * 14.33


516 * 729

182 * 257

7.17 * 10.12


To change the margins of an A4 page in the default.ppd, you would perform the following steps:

  1. Modify the default page from Letter to A4 in the following sections:

    *% Page definitions
    *DefaultPageSize: A4
    *PageSize A4: " "
    *% These entries set up the frame buffer. Usually used with manual feed.
    *DefaultPageRegion: A4
    *PageRegion A4: "A4"
    *% These provide the physical dimensions of the paper (by keyword)
    *DefaultPaperDimension: A4
    *PaperDimension A4: "595 842"  
  2. Add the margin definition in the following sections:

    *% Imageable (writable) areas for each page size, in pixels
    *DefaultImageableArea: A4
    *ImageableArea A4: "2 2 593 840 "


    All PPD entries are case sensitive. Adding a new font entry to PPD files

On PostScript printers, Oracle Reports only enables you to use fonts known to be available on the printer. Since printers are rarely available for personal requests on multiprocess operating systems, Oracle Reports gets a complete list of fonts from the PPD file.

When a new font is installed on the printer, a corresponding font entry needs to be added to the printer's PPD file. The format for a font entry is:

*Font {fontname}: {encoding} "({version})" {charset}


{fontname} is the Adobe font face name as specified in PostScript.

{encoding} is the PostScript encoding name.

{version} is the FontInfo version number.

{charset} is the Adobe character set.

The encoding value has slightly different meanings depending on the font type. If the encoding cannot be determined, the value of encoding may be set to unknown. Fonts are usually re-encoded by applications to provide other encodings; the charset value for each font indicates which encodings are possible for that font. For more information, please refer to the PPD specification from Adobe.

When new fonts are added to the printer, the matching AFM files must also be added to the font metrics directory. Oracle Reports requires the AFM files to get the actual font attributes and properly place text on the printed page.


Suppose you add a new font, CodedreineunBold, and want to edit the PPD file to include the new font.

  1. In the PPD file, search for:

    *% Font Information
  2. For the new font, append the following at the end of the paragraph:

    *Font CodedreineunBold: Standard "(00.1001)" Standard ROM Overriding the printer tray setting

The PostScript output generated by Oracle Reports has the tray information embedded into it. The PPD file defines the default tray to be used and is followed by the definitions of valid trays for the printer. To print to a different tray, the DefaultInputSlot entry in the PPD file must be updated.

In the PPD file, you should find a section that lists the default tray and the valid input slots. The section typically starts with a line like this one:

*OpenUI *InputSlot:   <PickOne>

The default tray entry looks like the following:

*DefaultInputSlot: Lower

The defined slots typically follow the default entry and look like the following:

*InputSlot Upper/Multipurpose Tray: "
*InputSlot Lower/Paper Cassette: "

The section ends with a line like the following:

*CloseUI: *InputSlot

You can set DefaultInputSlot to be any of the values in the list of defined slots. Editing HPD files for PCL printing

In some cases, you may need to change certain attributes in you HPD file. The sections that follow describe some of the attributes that you would commonly want to change: Changing the paper size

For example, to change the papersize to A4, add the following to the HPD file used:

 <defaultpaper=A4> Adding a new font entry

As with PostScript's AFM files, every HP font must have a TFM file in order for Oracle Reports to use it. The font vendor should provide TFM files. You should add new fonts to the HPD file when you install them.

You must specify the following settings in the HPD file for any new font:

FONT={fontname}        # {fontname} is a descriptive name for the font
/tfm={tfm-filename}    # {tfm-filename} is the base filename for TFM file


The font name entries in HPD files must be unique.