Skip Headers

Oracle® Application Server Reports Services Publishing Reports to the Web 10g (9.0.4) Part Number B13673-01 |
| Home | Contents | Index

# 6 Using PDF in Oracle Reports

Adobe Portable Document Format (PDF) is a universal file format that preserves all the fonts, formatting, graphics, and color, of any source document regardless of the application and platform used to create it. Oracle Reports was one of the first report generation tools to embrace this technology and generate quality PDF documents.

This chapter contains the following main sections:

- PDF Features Included in Oracle Reports

  This section contains information on the various PDF features supported by Oracle Reports. This includes compression, font aliasing, font subsetting, font embedding, accessibility, and taxonomy.

- Resolving PDF Font Issues During Cross-Platform Deployment

  This section contains information on resolving PDF font issues that occur when you design a report on a Windows platform and deploy it on a UNIX platform.

- Generating a Unicode PDF File

  This section contains information on how to generate a PDF file using Unicode character sets.

- Generating a BiDi PDF File

  This section contains information on how to generate a PDF file using bidirectional (BiDi) languages such as Hebrew and Arabic.

- Generating a Multibyte PDF File

  This section contains information on how to generate a PDF file using multbyte fonts.

- Generating a Barcode PDF File

  This section contains information on how to generate a Barcode PDF file.

## 6.1 PDF Features Included in Oracle Reports

Oracle Reports supports PDF 1.4 and is capable of generating high fidelity PDF reports on all platforms. The PDF features supported by Oracle Reports include:

- Compression

- Font Related Features

- Accessibility

- Taxonomy

- Enhanced Graph Support

### 6.1.1 Compression

PDF compression decreases the PDF file size, thereby reducing the time spent in downloading the PDF file.

The amount of space saved using compression varies based on the contents of the report, for example, the number of images versus the size of the content.

- Images: PDF compression does not significantly affect the size of files containing images in it, as image files are typically already compressed.

- Formatted data: Highly formatted data can achieve higher compression rates. However, actual compression rates will vary for each report.

Compressed files are about one fifth the size of the original file. Testing has shown that the best case compression ratio of one-eigth to the worst case compression ratio of one-half was achieved based on the contents in the original file.

#### 6.1.1.1 Setup

Oracle Reports implements a command line option to control the compression level of the PDF output. The PDF output from Oracle Reports is compressed, by default, and can be switched off or varied using the command line option: `PDFCOMP.`

Table 6-1 indicates which commands can use the `PDFCOMP` keyword.

Table 6-1 Commands that can use PDFCOMP

rwclient | rwrun | rwbuilder | rwconverter | rwservlet | rwcgi | rwserver
--- | --- | --- | --- | --- | --- | ---
yes | yes | no | no | yes | yes | no

Description

Use `PDFCOMP` to specify whether PDF output should be compressed.

Syntax

`PDFCOMP=``value``|{YES|NO}`

Values

- `value` Any value 0 through 9. A value of 0 means the PDF file will not be compressed. A value of 1 through 9 will compress the PDF file and permit users to control the compression level.

  Note: Levels 0 through 9 provide incremental levels of compression. 0 being no compression and 9 being the maximum amount of compression. The greater the compression you apply, the longer it will take the report to generate the PDF file.

- `YES` Compresses output at compression level 6.

- `NO` Compresses output at compression level 0 (no compression).

Default

`6`

Although compressed files download quickly, the time taken to generate a compressed file is much slower when compared to a non-compressed file.

Figure 6-1 Compressed Output vs. Non-Compressed Output

Description of the illustration pdf_compression.gif

Note: Compression rate depends on the report’s content; thus, the time taken to generate the PDF file as well as the PDF file size will vary from report to report.

### 6.1.2 Font Related Features

This section outlines the various font-related features supported by Oracle Reports.

#### 6.1.2.1 Font aliasing

Font aliasing enables you to substitute one font for another, i.e., font-to-font substitution. This font-to-font substitution is usually used when porting applications (in this case, your PDF file) across platforms. You can alias multibyte fonts as well as character sets.

Font aliasing occurs at the time of generating the PDF file. The PDF file will contain only the necessary font information required to display the output. The fonts used will not be embedded in the PDF file.

Note: The fonts must be available on the machine displaying the PDF output. The fonts need not be available on the machine generating the PDF file.

At the time of viewing the report, Adobe Acrobat replaces the aliased fonts based on the following:

1. If the fonts do not exist on the machine displaying the output, Adobe Acrobat substitutes it with the `Adobe` `Sans` `MM` font.

2. If the `Adobe` `Sans` `MM` font does not match, the output may display dots for the data.

Font aliasing will work with any or all of the following:

- Single byte fonts, including Eastern European fonts for both ASCII and IS0-Latin character sets

- Adobe multibyte Character ID (CID) fonts, both multibyte and Unicode fonts, which are available as a free download from Adobe

- Type 1 Postscript fonts

- TrueType fonts

##### 6.1.2.1.1 Setup

There are no command line options for font aliasing.

Include the font aliasing entries in the `uifont.ali` file. Oracle Reports aliases the font only when the entries in the `uifont.ali` file match the font information included in the generated PDF file.

Note: The `uifont.ali` file is located in: `ORACLE_HOME``\tools\common90 (`Windows`)` `ORACLE_HOME``/guicommon9/tk90/admin (`UNIX`)` The `uifont.ali` file is the configuration file controlling all the Oracle Reports PDF font enhancements. See Managing Fonts in Oracle Reports, for more information.

The section for font aliasing in the `uifont.ali` file is `[PDF]`.

The entry in the `uifont.ali` file for`:`

- Single byte fonts

      [PDF]
      "Font Name"="Font Name"

  Note: The font name entries should be enclosed within double quotes for font names containing two or more words. For example, `"Brush Script MT".`

- Multibyte fonts

      [PDF]
      Character Set = "Font Name"

or

    "Font Name"....Character Set="Font Name"

Note: The font name entries should be enclosed in double quotes for font names containing two or more words. For example, `"HeiseiKakuGo-W5-Acro".`

Here is an example of a font aliasing entry in the `uifont.ali` file:

    [ PDF ]
    /*Alias TrueType to available Type 1 font */
    "Kino MT" = UtopiaBold
    /*Alias multibyte to available CID font */
    .....SJIS = "HeiseiKakuGo-W5-Acro"

where:

- In`` `"Kino MT" = UtopiaBold`, Oracle Reports substitutes every `Kino MT` character found, with the `UtopiaBold` equivalent.

- In `.....SJIS = "HeiseiKakuGo-W5-Acro"``,` Oracle Reports`` substitutes every multibyte character set found, with the `HeiseiKakuGo-W5-Acro``` (CID) equivalent.

##### 6.1.2.1.2 Troubleshooting

If font aliasing does not work, verify that:

- In Acrobat Reader, click File > Document Properties > Fonts. Verify that the aliased font has been added to the list. If it is not included, then font aliasing did not occur. The fonts were not found or the entry in the `uifont.ali` file is incorrect.

- The fonts specified for the report are available on the machine where the report will be viewed.

- The `[PDF]` section name in the `uifont.ali` file has not been modified as Oracle Reports parses the file for the section name.

- The version of the Adobe Acrobat Reader used for viewing is version 3.0 or higher. This is the version required for multibyte character reports to display properly.

#### 6.1.2.2 Font Subsetting

PDF font subsetting is a variant of PDF font embedding. This option includes only the glyphs and character information that is actually used in the document.

With font subsetting, there is no dependency on the machine having the fonts installed. PDF font subsetting works for both single and multibyte fonts and is the preferred method of creating multibyte reports.

Note: Font subsetting will work only if the glyphs and font data are included in the PDF file.

##### 6.1.2.2.1 Setup

There are no command line options for font subsetting.

Before using the font subsetting feature you must:

- Include the font file paths in the `REPORTS_PATH` environment variable. Oracle Reports looks for fonts in the path specified in the `REPORTS_PATH` environment variable when generating a PDF file.

- Include the font subsetting entries in the `uifont.ali` file. Oracle Reports subsets the fonts only when the font entries listed in the `uifont.ali` file exist in the PDF file being generated.

The section for font subset in the `uifont.ali` file is `[PDF:Subset]`.

The entry in the `uifont.ali` file is :

    [PDF:Subset]
    Font Name = "Font File Name"

The file name entries should be enclosed within quotes; however, only font names containing two or more words should be enclosed within quotes.

The font file name referenced in the `uifont.ali` file must match the existing font file name for font subsetting to work correctly.

Note: The font file name is not the font name displayed in Reports Builder.

Example

    [PDF:Subset]
    Arial = "Arial.ttf"

Note: Oracle Reports supports `TTF` as well as `TTC`.

When you subset a font in a PDF file, it becomes a custom font because it contains only those characters needed for the report output.

Using Adobe Acrobat 3.0 or higher, you can view the fonts used in your report:

- File > Document Properties > Fonts.

- The Document Font dialog box displays Original Font, Type, Encoding, Actual Font (or the font used), and Type.

Figure 6-2 Font Subsetting

Description of the illustration pdf_fontsubsetting.gif

Note: In the case of font subsetting: The Encoding column will display Custom The Actual Font column will display F2 The Type column will display Type3 Type3 fonts are imaged characters that look slightly bolder than they would if expressed as a Type1 font.

Recommended

For optimum viewing, we recommend that you use Adobe Acrobat Reader 5.0 and set the following parameters in Adobe Acrobat Reader:

1. Edit > Preferences > General.

2. Display > Smoothing.

3. Select Smooth Text, Smooth Line Art, and Smooth Images.

4. (Laptop/LCD Screens) Select the Use CoolType check box.

5. Click OK.

PDF font subsetting in Oracle Reports works with TrueType fonts only and not with Type1 fonts. To include specific TrueType fonts in your report, convert Type1 fonts to TrueType fonts using available 3rd party tools.

There is a limitation on UNIX platforms when working with TrueType fonts. To work around this issue do the following:

1. Copy the TrueType fonts to the UNIX machine.

2. Ensure that the correct font path is specified in the `REPORTS_PATH` environment variable.

3. Run the report with the associated TrueType fonts. Refer to Designing the Report on and Deploying it on UNIX, for more information on running a report on UNIX machines.

##### 6.1.2.2.2 Troubleshooting

If font subsetting does not work, verify the following:

- In Acrobat Reader, click File > Document Properties > Fonts. Verify that the Actual Font value is Custom and Type is Type3. If this is not specified then font subsetting did not occur. The problem could be either that the fonts were not found or the entry in the `uifont.ali` file is incorrect.

- The font file names are valid.

- The font types are TrueType, i.e., `filename``.ttf/``filename``.ttc`.

- The font name is enclosed in double quotes if it consists of two or more words.

- The font name does not contain embedded parenthesis.

- The font files are located in the path specified by the `REPORTS_PATH` environment variable. When generating a PDF file, Oracle Reports looks for fonts in the path specified in the `REPORTS_PATH` environment variable.

- The font names are correct and are available on the machine where the PDF file is generated.

- The `[PDF:Subset]`section name in the `uifont.ali` file has not been modified. Oracle Reports parses the file looking for the section name.

- The version of the Adobe Acrobat Reader used for viewing is version 3.0 or higher. This is the version required for multibyte character reports to display properly.

- Fonts that are subset look bold. This is an issue with Type3 fonts, which are created during font subsetting. Type 3 fonts are imaged characters that look slightly bolder than they would if expressed as a Type 1 font. See Recommended for more information on improving the viewing quality.

  Refer to Designing the Report on and Deploying it on UNIX, for more information on running a report on UNIX machines.

#### 6.1.2.3 Font Embedding

PDF font embedding is the process of including the entire font set along with the data in the PDF file. PDF font subsetting and font embedding are mutually exclusive.

Note: Font embedding increases your PDF file size.

PDF font embedding in Oracle Reports is for Type1 fonts only (either single or multibyte fonts) and not for TrueType fonts. Convert TrueType fonts to Type1 fonts using available 3rd party tools in order to include specific Type1 fonts in your report.

PDF font embedding with Oracle Reports occurs between a font and a set of font file names.

Note: You must ensure that you have the necessary font licenses before embedding any fonts in your output.

##### 6.1.2.3.1 Setup

The setup for PDF embedding includes:

- A command line option: PDFEMBED

- An entry in the uifont.ali File Entry,`[PDF:Embed]`

The command line option `PDFEMBED` is used to specify whether Oracle Reports will embed the Type1 postscript fonts specified in the `uifont.ali` file into the PDF output.

Note: Font embedding will work only if the fonts are included in the PDF file.

PDFEMBED

Table 6-2 indicates which commands can use the `PDFEMBED` keyword.

Table 6-2 Commands that can use PDFEMBED

rwclient | rwrun | rwbuilder | rwconverter | rwservlet | rwcgi | rwserver
--- | --- | --- | --- | --- | --- | ---
yes | yes | no | no | yes | yes | no

Description

Use `PDFEMBED` to specify whether Oracle Reports will embed the Type1 PostScript font file(s) specified in the `uifont.ali` file into PDF output.

Syntax

`PDFEMBED={YES|NO}`

Values

- `YES` The PDF driver will embed the font(s) specified in the `[PDF:Embed]` header of the `uifont.ali` file into the PDF output.

- `NO` The font(s) will not be added to PDF output.

Default

`YES`

uifont.ali File Entry

The section for font aliasing in the `uifont.ali` file is `[PDF:Embed]`.

(Windows only) The entry in the `uifont.ali` file should be:

    Font Name = "Font Name.pfm Font Name.pfb"

(UNIX only) The entry in the `uifont.ali` file`` should be:

    Font Name = "Font Name.afm Font Name.pfa"

Example 6-1 Font Embedding

    [PDF:Embed]
    Symbol = "Symbol.pfm Symbol.pfb"

In Example 6-1, the Symbol font is embedded into the PDF file. This ensures portability by:

1. Creating the report with the Symbol`` font.

2. Embedding the Symbol font in the PDF file (Figure 6-3).

Figure 6-3 Font Embedding

Description of the illustration pdf_fontembedding.gif

##### 6.1.2.3.2 Troubleshooting

If PDF font embedding does not work, verify the following:

- In Acrobat Reader, click File > Document Properties > Fonts. Verify that the embedded font has been added to the list. If the font has not been added, then font embedding did not occur. The problem could be either that the fonts were not found or the entry in the `uifont.ali` file is incorrect.

- The correct font file name is used.

- The font path specified in the `REPORTS_PATH` environment variable is correct. When generating the PDF file, Oracle Reports looks for fonts in the paths specified in the `REPORTS_PATH` environment variable.

- The font type is a Type1 font.

- The font name is enclosed within double quotes if it consists of 2 or more words.

- The `[PDF:Embed]` section name in the `uifont.ali` file has not been modified. Oracle Reports parses the file looking for the section name.

- The format to specify the embedded font is valid

      Font Name="fontfilename.pfm/.afm file fontfilename.pfb/.pfa file".

  For example (Windows):

      UtopiaMediumItalic = "UtopiaMediumItalic.pfm UtopiaMediumItalic.pfb"

- The font name is correct and available on the machine where the PDF file is generated.

### 6.1.3 Precedence of Execution

The precedence order for the same font in multiple places within the`uifont.ali` file is as follows:

1. Font aliasing takes precedence over font embedding (highest)

2. Font embedding takes precedence over font subsetting (intermediate)

3. Font subsetting takes no precedence (lowest)

For example, if you have included the same font entries for both font embedding and font subsetting, then font embedding will override font subsetting. This is assuming you have not set the command line option of `PDFEMBED=NO`.

For all font features —font aliasing, font subsetting, and font embedding—include the specific entries first followed by the generic entries. For example, if you want to subset Arial Plain, Arial Bold, Arial Italic, and Arial Bold-Italic fonts, your entries should be in the following order:

    [ PDF:Subset ]
    Arial..Italic.Bold.. = "Arialbi.ttf"
    Arial...Bold.. = "Arialb.ttf"
    Arial..Italic... = "Ariali.ttf"
    Arial..... = "Arial.ttf"

If the plain `Arial..... = "Arial.ttf"` entry appears first, then all the styles of the Arial font in the layout will be subset as Arial Plain font. Here is a sample of a portion of the `uifont.ali` file for all the PDF entries containing all three PDF sections:

Sample 1

    [ PDF ]
    Palatino = "Kino MT.ttf"
    [ PDF:Subset ]
    Garmond..Italic.Bold.. =
    "Garmacbi.ttf"
    Garmond...Bold.. = "Garmacb.ttf"
    Garmond..Italic... = "Garmaci.ttf"
    Garmond..... = "Garamac.ttf"
    [ PDF:Embed ]
    Arial = "Arial.pfm Arial.pfb"

Sample 2

    [PDF]
    Arial.10.Italic = ÒTimes New Roman".12.Italic.Bold
    ÒCourier New" = Symbol
    [PDF:Embed]
    ÒTimes New Roman".14..Bold = ÒTimesBold.pfm TimesBold.pfb"
    [PDF:Subset]
    Verdana..Italic.Bold = ÒVerdanaz.ttf"
    Verdana…Bold = ÒVerdanab.ttf"

Table 6-3 Value Comparison of the various PDF types

PDF Type | Advantage | Disadvantage
--- | --- | ---
Font Aliasing | Multibyte support Good display Small file size (Japanese example; 23kb for font aliasing when compared to 130kb for font subsetting) | Unicode character set not supported Asian Font Packs are required on the client machine, if the client’s operating system and Acrobat Reader are not the native version. Limited fonts support . For example, there is no support for font emphasis.
Font Embedding | Guaranteed display | Only single byte support provided. Large file size.
Font Subsetting | Unicode support Guaranteed display | Inadequate display (*) No styles (Italic and Bold) support The generated PDF file cannot be edited using Acrobat Reader.

(*) Refer to Recommended for more information on how to correct this.

### 6.1.4 Accessibility

Oracle Reports provides several ways for you to include accessibility features in your PDF file. The PDF format file follows the tagged-PDF standard defined in PDF 1.4. This standard along with Acrobat Reader 5 (or higher) provides you with features for inclusion in the paper layout. The command line option to include accessibility features in your output is `ACCESSIBLE`.

Table 6-4 indicates which commands can use the `ACCESSIBLE` keyword.

Table 6-4 Commands that can use ACCESSIBLE

rwclient | rwrun | rwbuilder | rwconverter | rwservlet | rwcgi | rwserver
--- | --- | --- | --- | --- | --- | ---
yes | yes | yes | no | yes | yes | no

Description

Use `ACCESSIBLE` to specify whether accessibility-related features offered through Oracle Reports are enabled (`YES`) or disabled (`NO`) for the PDF file.

Syntax

`ACCESSIBLE={YES|NO}`

Values

- `YES` Accessibility features are enabled for PDF file.

- `NO` Accessibility features are not enabled for PDF file.

Default

`NO`

Using the additional properties (Figure 6-4), you can provide the required information necessary for generating PDF documents that can be interpreted by assistive technology. For more information on accessibility, see the Creating Accessible Enterprise Reports using Oracle9i Reports white paper on (`http://otn.oracle.com` )under Accessibility.

Figure 6-4 Accessibility

Description of the illustration pdf_accessibility.gif

### 6.1.5 Taxonomy

A PDF document can include global information about itself such as the document’s title, author, creation and modification dates. This global information proves useful at the time of cataloguing or searching for documents in external databases.

Oracle Reports provides properties to enable such a classification, otherwise known as taxonomy. They are:

- Title

- Author

- Subject

- Keywords

Table 6-5 Taxonomy Properties

Property Name | Type | Description | Default Value
--- | --- | --- | ---
Title | String | Document title | PDF document name
Author | String | Document’s author | Oracle Reports
Subject | String | Document’s subject | None
Keywords | String | Specifies keywords that can be used to categorize the document | None

Note: The taxonomy properties are report level properties.

Refer to the Reports Builder online help for more information on the taxonomy properties.

### 6.1.6 Enhanced Graph Support

Oracle Reports now provides enhanced support for graphs in PDF. This includes specifying a higher dots per inch (DPI) value to increase or improve the image resolution of the graph. The improved graph support enables you to scale the graph without compromising on the image quality.

The environment variable is `REPORTS_GRAPH_IMAGE_DPI`.

Description

The `REPORTS_GRAPH_IMAGE_DPI` environment variable specifies a dots per inch (DPI) value for graphs being output to a printer (PDF, PostScript, or PCL). This environment variable allows you to increase the earlier fixed default value of 72 DPI, which helps in improving the image resolution for printed (PDF, PostScript, or PCL) graphs.

Valid Values

72 through 300

Default

`250`

Usage Notes

- On Windows, use the registry to specify the value. On Unix/Linux, set the environment variable in `reports.sh`.

- Generating a high resolution chart will increase the PDF file size relatively and the time taken to generate the PDF file/printer output.

- When you set a DPI value greater than 250 and your chart is bigger than 5"x5" (approximately), you may also need to change the JVM heap size value via `REPORTS_JVM_OPTIONS` to avoid the `Out Of Memory` error for the JVM. See REPORTS_JVM_OPTIONS, for more information on setting the JVM options

- To revert to the old behavior, set the value of this environment variable to 72 DPI.

- This variable is currently not supported in Oracle Reports distribution functionality as this is specific to PDF, PS, and printer outputs only.

## 6.2 Resolving PDF Font Issues During Cross-Platform Deployment

There are font and text alignment issues when you design a report (single byte or multibyte) on the Windows platform and deploy it on a UNIX platform. The reason is that the font handling and windowing system are completely different across the two platforms.

### 6.2.1 Designing and Deploying the Report on the Same Platform

Your report is designed and deployed on the same platform, e.g., Windows:

- There should be no font or text alignment issues in the PDF file.

- If the PDF file is generated with font subsetting enabled, then the PDF file can be viewed in the same manner across platforms.

### 6.2.2 Designing the Report on and Deploying it on UNIX

Your report is designed on the Windows platform and deployed on the UNIX platform.

(Windows) You use the TrueType fonts located in the Windows machine. Oracle Reports queries the font information from the Windows system for formatting the report.

(UNIX) When this report is sent to PDF on Solaris or any other UNIX platforms, there are two stages:

1. Oracle Reports renders the font metrics information for the fonts and uses this information to format various objects in the report.

   Note: Oracle Reports renders the font metrics information from the `AFM` files mentioned in the printer’s `PPD` file.

2. Oracle Reports then looks for the entries in the `[PDF]` section of the `uifont.ali` file. For font subsetting, Oracle Reports refers to the `[PDF: Subset]` section and subsets the TrueType fonts from the given location. The subsetted fonts are then embedded in the PDF file.

   Note: The corresponding `AFM` files for all the TrueType fonts used in your report should be available on the UNIX machine to ensure adequate formatting is enforced.

#### 6.2.2.1 Step by Step Procedure for Single Byte fonts

This section outlines the steps involved in generating a PDF report (using single byte fonts) designed on the Windows platform on either Solaris or any other UNIX platform. These steps are required only if you see font alignment issues in your PDF output.

1. Create a report on the Windows platform with TrueType fonts. For this procedure, the fonts referred to are `arial.ttf` and `tahoma.ttf`.

2. Copy the fonts (`arial.ttf` and `tahoma.ttf`) and your report’s `.rdf` file to the UNIX platform. The path for the font files should be `ORACLE_HOME/font folder`. Add the font file’s path to the `REPORTS_PATH` environment variable.

3. Create the AFM files for the font files `(arial.ttf` and `tahoma.ttf)`.

4. Copy the AFM files (`arial.afm` and `tahoma.afm`) generated to `ORACLE_HOME``/guicommon9/tk90/admin/AFM.`

   Note: The AFM files should be copied to the AFM directory without the `.afm` extension. Additionally, ensure that the name of `afm` file, the name of the font in the .`ppd` file, and the name of the font the `uifont.ali` file are an exact match.

5. Ensure that the `TK_PRINTER` environment variable or the `PRINTER` environment variable is set to the printer name. For example, `hrprinter`.

6. Ensure that the `uiprint.txt` file has the following entry:

       printer name:PostScript:2:test:default.ppd:

   For example:

       hrprinter:PostScript:2:test:default.ppd:

7. Add the AFM entries to the `ppd` file.

   Note: This `ppd` file is the first entry in the `uiprint.txt` file and contains your font information. The default `ppd` file is `datap462.ppd`.

       *Font arial: Standard "(001.001)" Standard ROM
       *Font tahoma: Standard "(001.001)" Standard ROM

8. Ensure that there are no entries in the [`PDF:Subset`] section at this time in the `uifont.ali` file`.`

9. Run the report to generate the PDF file. In Acrobat Reader, click File > Document Properties > Fonts or File >Document Info > Fonts:

   1. The Original Font column displays the Arial and Tahoma fonts.

   2. There will be some font alignment issues.

10. Add the following entry in the `uifont.ali` file:

        [ PDF:Subset ]
        "arial" = "arial.ttf"
        "tahoma" = "tahoma.ttf"

11. Run the report again to generate the PDF file. The PDF file should not contain any font alignment issues.

    To confirm that the fonts are subset in the PDF file:

    1. In Acrobat Reader, click File > Document Properties > Fonts.

    2. The Original Font column should display F2, the Encoding column should display Custom, and the Type column should display Type3.

#### 6.2.2.2 Step by Step Procedure for MultiByte and Unicode fonts

There are additional steps for generating reports with multibyte fonts. The steps involved in resolving font issues with PDF subsetting when deploying multibyte reports on UNIX platforms are as follows:

1. Create a report on the Windows platform using TrueType multibyte fonts with the appropriate character set. For this procedure the font and the character sets referred to are the Korean font `h2mjsm.ttf` and the `KO16KSC5601` character set.

2. Copy the Korean font `h2mjsm.ttf` and your report’s `.rdf` file to the UNIX platform. The font file path should be `$ORACLE_HOME/``font folder`. Add the font file’s path to the `REPORTS_PATH` environment variable.

3. Create the AFM files for the Korean font `h2mjsm.ttf`.

4. Copy the AFM file to the following location:

       $ORACLE_HOME/guicommon9/tk90/admin/AFM/.
       % cp h2mjsm.afm ORACLE_HOME/guicommon9/tk90/admin/AFM/h2mjsm

5. Ensure that the `TK_PRINTER` environment variable or the `PRINTER` environment variable is set to the printer name. For example, `hrprinter`.

6. Ensure the `uiprint.txt` file has the following entry:

       printer name:PostScript:2:test:default.ppd:

   For example:

       hrprinter:PostScript:2:test:default.ppd:

7. Add the following lines in the `.ppd` file:

   Note: This `ppd` file is the first entry in the `uiprint.txt` file and contains your font information. The default `ppd` file is `datap462.ppd`.

       *DefaultFont: h2mjsm
       *Font h2mjsm: Special "(001.001)" Special ROM

8. Comment the Symbol line in the file:

       *%Font Symbol: Special "(001.001)" Special ROM

9. Edit the following section in the `uifont.ali` file to mention the font used for the character set:

   Note: The `uifont.ali` file is located in: `ORACLE_HOME``\tools\common90 (`Windows`)` `ORACLE_HOME``/guicommon9/tk90/admin (`UNIX`)` The `uifont.ali` file is the configuration file controlling all the Oracle Reports PDF font enhancements. Refer to Chapter 4, " Managing Fonts in Oracle Reports", for more information.

       [ Global ]
       .....ko16ksc5601 ="h2mjsm"
       [ Printer:PostScript2 ]
       .....ko16ksc5601 ="h2mjsm"

10. Ensure that there are no entries in any of the `[PDF]` or `[PDF:Subset]` sections at this time in the `uifont.ali` file.

11. Run the report to generate the PDF file. In Acrobat Reader, click File > Document Properties > Fonts or File > Document Info > Fonts:

    1. The Original Font column displays the h2mjsm font.

    2. There will be some font alignment issues.

12. Add the following entries in the `uifont.ali` file to enable PDF subsetting:

        [ PDF:Subset ]
        "h2mjsm"="h2mjsm.ttf"

13. Run the report again to generate the PDF file. The PDF file should not contain any font alignment issues.

    To confirm that the fonts are subset in the PDF file:

    1. In Acrobat Reader, click File > Document Properties > Fonts or File > Document Info > Fonts.

    2. The Original Font column should display F2, the Encoding column should display Custom, and the Type column should display Type3.

       Note: There might be some variations in the alignment, as the font metrics handling is different in UNIX and Windows. This issue cannot be avoided. A PDF file generated with the font subsetting enabled might have some font style issues (e.g., some content could be displayed as bold) when viewed in Acrobat Reader. This is because Acrobat Reader has a limitation while displaying the Type 3 fonts. See Recommended for more information on how to smoothen the display for Type 3 fonts.

## 6.3 Generating a Unicode PDF File

This section outlines the steps involved in generating a PDF file with a Unicode character set.

### 6.3.1 Font Subsetting

The steps involved in generating a Unicode PDF file using the font subsetting feature are as follows:

1. Set `NLS_LANG=AMERICAN_AMERICA.UTF8.`

2. Set `REPORTS_PATH` to the font directory in which the TrueType font exists. For example, `C:\WINNT\Fonts`.

3. Open the`uifont.ali` file and edit the `[PDF:Subset]` section to specify the TrueType font name.

   Note: The `uifont.ali` file is located in: `ORACLE_HOME``\tools\common90 (`Windows`)` `ORACLE_HOME``/guicommon9/tk90/admin (`UNIX`)`

   Example

       [ PDF:Subset ]
       "Andale Duospace WT J" = "Aduoj.ttf"
       "Albany WT J"="AlbanWTJ.ttf"

   The specified font should cover the Unicode range that your report uses.

4. Create a report having MLS data and set its font to the Unicode font.

5. Run a report having `MLS` data with `DESTYPE=FILE DESFORMAT=PDF.`

## 6.4 Generating a BiDi PDF File

This section outlines the steps involved in generating a PDF file for bidirectional (BiDi) languages.

Oracle Reports provides two environment variables that resolve font re-shaping and numeric options with bidirectional (BiDi) languages, such as Hebrew and Arabic. They are:

1. `REPORTS_BIDI_ALGORITHM`

   This environment variable switches the layout algorithm for bidirectional (BiDi) languages (for example, Arabic or Hebrew). The valid values for this environment variable are `ORACLE` or `UNICODE`.

   See Also: REPORTS_BIDI_ALGORITHM For more information on the environment variable.

2. `REPORTS_ARABIC_NUMERAL`

   This environment variable specifies the numeric format for Arabic PDF output.

   See Also: REPORTS_ARABIC_NUMERAL For more information on the environment variable.

### 6.4.1 Font Subsetting

The steps involved in generating a PDF file for bidirectional (BiDi) languages using the font subsetting feature are as follows:

1. Set `NLS_LANG=ARABIC_EGYPT.AR8MSWIN1256` (or `AR8ISO8859P6` on UNIX)

2. Set `REPORTS_PATH` to the font directory in which the TrueType font exists. For example, `C:\WINNT\Fonts`.

3. Open the `uifont.ali` file and edit the `[PDF:Subset]` section to specify the TrueType font name.

   Note: The `uifont.ali` file is located in: `ORACLE_HOME``\tools\common90 (`Windows`)` `ORACLE_HOME``/guicommon9/tk90/admin (`UNIX`)`

   Example

       [PDF:Subset]
       "Andale Duospace WT J" = "Aduoj.ttf"
       "Albany WT J"="AlbanWTJ.ttf"

4. Create a report having Arabic data and set it to the font specified in the example.

5. Run a report with `DESTYPE=FILE DESFORMAT=PDF`.

## 6.5 Generating a Multibyte PDF File

This section outlines the steps involved in generating a PDF file with multibyte fonts.

Figure 6-5 outlines the mapping table between Oracle `NLS_CHARACTERSET`, CMap name, and its CID font name used in aliasing pdf.

Figure 6-5 CID Font Mapping for Aliasing PDF

Description of the illustration pdf_cidfont_bw.gif

(*) Those fonts are available Adobe in Acrobat Reader Version 5

(**) Those fonts are available Adobe in Acrobat Reader Version 4

It is recommended that you use Version 5 CIDFonts(*) with Acrobat Reader 5.0 in order to avoid unexpected font mapping, which results in multibyte characters overlapping.

### 6.5.1 Font Aliasing

The steps involved in generating a PDF file for multibyte fonts using the font aliasing feature are as follows:

1. Set `NLS_LANG=JAPANESE_JAPAN.JA16SJIS` (or `JA16EUC` on UNIX)

2. Open the `uifont.ali` file located and set the font alias under the `[PDF]`section.

   Note: The `uifont.ali` file is located in: `ORACLE_HOME``\tools\common90 (`Windows`)` `ORACLE_HOME``/guicommon9/tk90/admin (`UNIX`)`

   Example

       [ PDF ]
       .....JA16SJIS = "KozMinPro-Regular-Acro"
       "MS UI Gothic".....JA16SJIS = "KozMinPro-Regular-Acro"

1. Create a report having Japanese data with the Japanese font (`MS UI Gothic`).

2. Run a report with `DESTYPE=FILE DESFORMAT=PDF`.

3. If your Acrobat Reader is a non-Japanese version installed on a non-Japanese operating system, you need to install the Japanese font pack from Adobe's site.

   If you view the PDF file with the Japanese version of Acrobat Reader 4.0/5.0 on the Japanese version of Windows, you do not need to install the Japanese font pack.

#### 6.5.1.1 Font Subsetting

The steps involved in generating a PDF file for multibyte fonts using the font subsetting feature are as follows:

1. Set `NLS_LANG=JAPANESE_JAPAN.JA16SJIS` (or `JA16EUC` on UNIX)

2. Set the `REPORTS_PATH` environment to the font directory in which the TrueType font exists. For example, `C:\WINNT\Fonts`.

3. Open the `uifont.ali` file located in the `ORACLE_HOME``\tools\common90` directory and edit it at the `[PDF:Subset]` section to specify the TrueType font name.

   Example

       [ PDF:Subset ]
       "Andale Duospace WT J" = "Aduoj.ttf"
       "Albany WT J"="AlbanWTJ.ttf"
       "MS UI Gothic" = "msgothic.ttc"

4. Create a report having Japanese data and set it to the font mentioned in the example.

5. Run a report with `DESTYPE=FILE DESFORMAT=PDF`.

## 6.6 Generating a Barcode PDF File

This section outlines the steps involved in generating a PDF file with barcode information.

### 6.6.1 Font Embedding

The steps involved in generating a barcode PDF file using the font embedding feature are as follows:

1. Set the `REPORTS_PATH` environment variable to the font directory containing the Type1 font.

2. Open the `uifont.ali` file and include the following under the font embed `[PDF:Embed]` section.

   Note: The `uifont.ali` file is located in: `ORACLE_HOME``\tools\common90 (`Windows`)` `ORACLE_HOME``/guicommon9/tk90/admin (`UNIX`)`

   Example

       [ PDF:Embed ]
       SAdHC39a = "SAdHC39a.pfm SAdHC39a.pfb"

3. Create a report having Barcode data and set its font to the one mentioned in the example.

4. Run a report with `DESTYPE=FILE DESFORMAT=PDF`.

#### 6.6.1.1 Font Subsetting

The steps involved in generating a barcode PDF file using the font subsetting feature are as follows:

1. Set the `REPORTS_PATH` environment variable to the directory containing the TrueType font. For example, `C:\WINNT\Fonts`.

2. Open the `uifont.ali` file in the `ORACLE_HOME``\tools\common90` directory and include the following under the `[PDF:Subset]` section to specify the TrueType font name:

   Example

       [ PDF:Subset ]
       SAdHC39a = "SAdHC39a.ttf"

3. Create a report having Barcode data and set it to the font mentioned in the example.

4. Run a report with `DESTYPE=FILE DESFORMAT=PDF.`