Host Printing Reference

IBM WebSphere Host On-Demand Version 10.0

Host Printing Reference

SC31-6353-02

Eighth Edition (March 2006)

This edition applies to Version 10.0 of IBM (R) WebSphere Host On-Demand (program number 5724-I20) and to all subsequent releases and modifications until otherwise indicated in new editions.

(C) Copyright International Business Machines Corporation 1997, 2004. All rights reserved.
Note to U.S. Government Users -- Restricted Rights -- Use, duplication, or disclosure restricted by GSA, ADP Schedule Contract with IBM Corp.


Contents:


About this book
Conventions used in this book
Introduction to Host Printing (3270)
      Automatic detection of LU type
      Emulation of a 3287 printer
      The Print Setup Window (3270)
            Print methods
            Using the print methods on the Windows platform
            Using the print methods on UNIX, AIX, or Linux
            Using the print methods on OS/2
      Print Technologies
            Windows Native Printer Interface mode
            Windows Spooler Interface mode
            Java File Interface mode
      Specifying a File Path and Name
      Creating Adobe PDF Files
      Creating a PDT file
            More about Printer Definition Files
            More about Printer Definition Tables
            Starting the Printer Definition Table Compiler
            Locating Predefined Printer Definition Files and Tables
            Supported Printer Emulation Modes
Creating a Printer Definition Table (3270)
      Creating a Printer Definition File
      Using the Printer Definition Table Compiler
            Printer Definition Table Description
            Running the Compiler in Graphical Mode
            Running the Compiler in Nongraphical Mode
Understanding the Format of Printer Definition Files (3270)
      Macro Definitions
      Formatting Controls
            Session Parameters
                   ASCII_PASSTHRU? Keyword Support
                   EBCDIC_PASSTHRU? Keyword Support
            Control Codes
                   Control Codes used for both SBCS and DBCS Languages
                          START_JOB and END_JOB
                          SET_VARIABLE_LINE_DENSITY
                          CHARACTER_PITCH
                          REVERSE_VIDEO and BLINK
                   Using Custom Control Codes (LU1 and LU3)
                   Additional Control Codes for DBCS
                   Definition of Printer Control Code Parameters
      Character Definitions
Introduction to Host Printing (5250)
      Host Print Key
      Host Print Transform
Introduction to Host Printing (VT)

Appendix A. Printer Data Stream Information (3270)
      Introduction to Print Data Stream
      Supported Commands and Orders in the 3270 Data Stream
            Write Control Character (WCC) byte
      Query Replies
      Function Management Header 1 (FMH-1) Support
      Delimiting Print Jobs
      SNA Character String Data Stream
      Command Descriptions
Appendix B. National Language Support
      Euro Currency Symbol Support
      Japanese Code Page Support
      User-defined Characters for Host Printing Sessions
Appendix C. Advanced Configuration Options (3270)
Appendix D. Troubleshooting
      Error conditions with Windows 98 and Windows Me
      Inactivity Timer
      Problem Resolution
      What to do if you still have a problem
Appendix E. Associated Printer Sessions (3270)
Appendix F. Printer Definition File Example (3270)
Appendix G. Notices
      Trademarks

About this book

The Host Printing Reference describes the host printing functions provided by Host On-Demand.

This document is written for application developers and administrators.

The Host Printing Reference is also available both on the product CD-ROM and in the Host On-Demand online Information Center at http://publib.boulder.ibm.com/infocenter/hod9help.

The MySupport feature enables you to personalize your support view and to register to receive weekly e-mail notifications alerting you to new patches, new downloads, and other timely technical support information for IBM products. To register for MySupport, follow the instructions in the Technote found at the following URL: http://www.ibm.com/support/docview.wss?rs=132&context=SS5RCF&uid=swg21168680&loc=en_US&cs=utf-8&lang=en+en

Conventions used in this book

The following typographic conventions are used in the Host Printing Reference:

Convention Meaning
Monospace Indicates text you must enter at a command prompt and values you must use literally, such as commands, functions, and resource definition attributes and their values. Monospace also indicates screen text and code examples.
Italics Indicates variable values you must provide (for example, you supply the name of a file for file_name). Italics also indicates emphasis and the titles of books.
Return Refers to the key labeled with the word Return, the word Enter, or the left arrow.

Graphic Image
This graphic is used to highlight notes to the reader.




Introduction to Host Printing (3270)

The Host On-Demand client supports 3270 printing. You can direct a 3270 Logical Unit Type 3 (LU3) or Logical Unit Type 1 (LU1) print data stream to any of the following print destinations:

A Host On-Demand 3270 printer session emulates an IBM 3287 printer running in either LU3 or LU1 mode.

Automatic detection of LU type

When you configure a 3270 Printer session, you do not have to specify whether the session uses LU Type 3 or LU Type 1. Instead, the Host On-Demand client automatically detects the LU type when the client connects with the 3270 host.

The term Logical Unit (LU) comes from the Systems Network Architecture (SNA). In a 3270 Printer session, the Host On-Demand client connects with a Telnet server rather than with an SNA server. However, the LU3 or LU1 data stream transmitted by the Telnet server is identical with the LU3 or LU1 data stream transmitted by an SNA server.

Emulation of a 3287 printer

Because the purpose of a Host On-Demand 3270 Printer session is to emulate a 3287 printer, a 3270 Printer session does not offer the same options that you may be used to seeing when you print a document from a word-processing program. In particular, you will find these differences:

The Printer Setup window (3270)

This section contains background information to help you understand how to configure the Printer Setup window for a 3270 Printer session.

To open the Printer Setup window for a 3270 Printer session, follow these steps:

  1. Open the session properties window for a 3270 Printer session.
  2. In the left pane, click Printer Setup.

You can also open the Printer Setup window from other contexts (see Printer Setup (3270 Printer session, 5250 Printer session, and 3270 Display session) in the online help). Configuring the Printer Setup window in these contexts is similar to the configuration described here.

Print methods

The Print to listbox at the top of the Printer Setup window offers (depending on the client platform) up to five print methods:

These five print methods employ a somewhat confusing variety of print technologies, which are described in a later section (see Print Technologies ). The current section attempts to steer clear of describing print technologies and instead to describe only how to configure the Printer Setup window to accomplish various tasks.

The following sections describe how to use the print methods on the following Host On-Demand client platforms.

Using the print methods on the Windows platform

The following table shows the print methods available when the Host On-Demand client is running on a Windows platform and summarizes the characteristics associated with each print method:

Print method: Characteristics:
A. Windows Printer, with Use Printer Definition Table set to No
  • Default method for this platform.
  • You can select a Windows printer.
  • You can select a Windows font.
  • You can easily modify Windows printer properties (such as Portrait or Landscape, Pages Per Sheet, Print Quality, and other properties) using the Windows Print Setup dialog.
  • This print method is useful when it is not possible to access the printer without using the Windows printer driver (as is the case with a USB printer or a Windows-only printer) or when a PDT file is not available (as is the case with a PostScript printer).
  • This print method can print some special characters (such as the euro character) even if the special characters are not present in the printer's firmware.
  • Processing is slower than with print method B.
  • This print method may not be able to handle the 3270 data stream command TRN (Transparent).
B. Windows Printer, with Use Printer Definition Table set to Yes
  • The administrator must provide a Printer Definition Table (PDT).
  • You can select a Windows printer.
  • This print method cannot print some special characters (such as the euro character) unless the special characters are present in the printer's firmware.
  • Processing is faster than with print method A.
C. Other Printer (always uses a Printer Definition Table)
  • This print method is called Printer on non-Windows platforms.
  • The administrator must provide a Printer Definition Table (PDT).
  • Normally you do not need to use this print method on the Windows platform.
D. File, with Use Adobe PDF set to No (always uses a Printer Definition Table)
  • The administrator must provide a Printer Definition Table (PDT).
  • This print method is useful if you do not want to send the print output to a printer immediately.
  • This print method is useful if you want to generate print output in a flat ASCII format.
E. File, with Use Adobe PDF set to Yes (does not use a Printer Definition Table)
  • A PDT is not required.
  • The print output is written to the specified file in Adobe PDF format.
The remainder of this subsection describes how to use each print method on the Windows platform.
A. Windows Printer, with Use Printer Definition Table set to No

This is the default print method for the Host On-Demand client running on a Windows platform. To select this print method:

  1. Open the Printer Setup window.
  2. Expand the Print to listbox and click Windows Printer.
  3. Set Use Printer Definition Table to No.

You can select the Windows printer that you want to use, either a local printer or a network printer. To select a Windows printer:

  1. Open the Printer Setup window.
  2. To use the default Windows printer, set Choose Windows Printer to Use Default.
  3. To select another Windows printer:
    1. Set Choose Windows Printer to Other.
    2. Click Select Printer

You can select a Windows font. To select a Windows font:

  1. Open the Page Setup window.
    1. In the session properties window, in the left pane, click Page Setup.
  2. Click Select Font.
  3. In the Font window, select a font from the Font column.
    • Do not use the Font style and Size settings in the Font window. Even though these settings appear to be enabled, they have no effect on Host On-Demand client printing.

You can easily modify Windows printer properties (such as Portrait or Landscape, Pages Per Sheet, Print Quality, and other properties) using the Windows Print Setup dialog. To modify Windows printer properties:

This print method (Windows Printer, with Use Printer Definition Table set to No) is useful when it is not possible to access the printer without using the Windows printer driver (as is the case with a USB printer or a Windows-only printer) or when a PDT file is not available (as is the case with a PostScript printer).

Because this print method uses Windows Native Printer Interface (WPNI) mode:

B. Windows Printer, with Use Printer Definition Table to Yes

To select this print method:

  1. Open the Printer Setup window.
  2. Expand the Print to listbox and click Windows Printer.
  3. Set Use Printer Definition Table to Yes.
  4. Expand the Printer Definition Table listbox and select a PDT.

Before the Host On-Demand client can use this print method, the Host On-Demand administrator must provide a Printer Definition Table (PDT) (see Creating a PDT file ).

You can select the Windows printer that you want to use, either a local printer or a network printer. To select a Windows printer:

  1. Open the Printer Setup window.
  2. To use the default Windows printer, set Choose Windows Printer to Use Default.
  3. To select another Windows printer:
    1. Set Choose Windows Printer to Other.
    2. Click Select Printer

Because this print method uses Windows Spooler Interface (WSI) mode:

C. Other Printer (always uses a Printer Definition Table)

On non-Windows platforms, this print method is called Printer.

Normally you do not need to use this print method on the Windows platform. It produces the same output as method A or method B, but is less user friendly.

To select this print method:

  1. Open the Printer Setup window.
  2. Expand the Print to listbox and click Other Printer.
  3. Expand the Printer Definition Table listbox and select a PDT.

Before the Host On-Demand client can use this print method, the Host On-Demand administrator must provide a Printer Definition Table (PDT) (see Creating a PDT file ).

In the Printer Name field, you can type any one of the following:

D. File, with Use Adobe PDF set to No (always uses a Printer Definition Table)

To select this print method:

  1. Open the Printer Setup window.
  2. Expand the Print to listbox and click File.
  3. Set Use Adobe PDF to No.
  4. In the File Path and Name field, type a valid file path and name.
  5. Expand the Printer Definition Table listbox and select a PDT.

Before the Host On-Demand client can use this print method, the Host On-Demand administrator must provide a Printer Definition Table (PDT) (see Creating a PDT file ).

For the file path and name, see Specifying a File Path and Name.

You can also use the File Path and Name field to specify one or more native console commands to be run after the host print job completes (see Running external commands after host print jobs in the online help).

This print method is useful when you do not want to send the print output to a printer immediately. For example:

This print method also is useful when if you want to generate print output in a flat ASCII format.

E. File, with Use Adobe PDF set to Yes (does not use a Printer Definition Table)

To select this print method:

  1. Open the Printer Setup window.
  2. Expand the Print to listbox and click File.
  3. Set Use Adobe PDF to Yes.
  4. In the File Path and Name field, type a valid file path and name.

The Host On-Demand client transforms the print output to binary data in Adobe PDF format, and writes the binary data into the specified file. The file can be viewed with Adobe Reader version 4.0 or later.

This print method is useful when you want to transform the data to a portable and easily viewable format.

This method does not require a PDT.

Using the print methods on UNIX, AIX, or Linux

The following table shows the print methods available when the Host On-Demand client is running on a UNIX, AIX, or LINUX platform, and summarizes the characteristics associated with each print method:

Print method: Characteristics:
A. Windows Printer, with Use Printer Definition Table set to No
  • Not available on UNIX, AIX, or Linux.
B. Windows Printer, with Use Printer Definition Table set to Yes
  • Not available on UNIX, AIX, or Linux.
C. Printer (always uses a Printer Definition Table)
  • This print method is called Other Printer on Windows platforms.
  • This is the default print method for UNIX, AIX, and Linux.
  • The administrator must provide a Printer Definition Table (PDT).
D. File, with Use Adobe PDF set to No (always uses a Printer Definition Table)
  • The administrator must provide a Printer Definition Table (PDT).
  • This print method is useful if you do not want to send the print output to a printer immediately.
  • You must also use this method when you want to send the print output to a network printer.
E. File, with Use Adobe PDF set to Yes (does not use a Printer Definition Table)
  • A PDT is not required.
  • The print output is written to the specified file in Adobe PDF format.
The remainder of this subsection describes how to use each print method on the UNIX, AIX, and Linux platforms.
A. Windows Printer, with Use Printer Definition Table set to No

This print method is not available on UNIX, AIX, or Linux.

B. Windows Printer, with Use Printer Definition Table set to Yes

This print method is not available on UNIX, AIX, or Linux.

C. Printer (always uses a Printer Definition Table)

On Windows platforms, this print method is called Other Printer.

This is the default print method for the Host On-Demand client when it is running on a UNIX, AIX, or Linux platform. To select this print method:

  1. Open the Printer Setup window.
  2. Expand the Print to listbox and click Other Printer.
  3. Expand the Printer Definition Table listbox and select a PDT.

Before the Host On-Demand client can use this print method, the Host On-Demand administrator must provide a Printer Definition Table (PDT) (see Creating a PDT file ).

To send the print output to a printer attached directly to the workstation, you must type a valid device name (such as /dev/lp0) into the Printer Name field. The Host On-Demand client writes the print data stream to the device that you specify.

To send the print output to a network printer, you cannot use this method on UNIX, AIX, or Linux. Instead, use method D.

D. File, with Use Adobe PDF set to No (always uses a Printer Definition Table)

To select this print method:

  1. Open the Printer Setup window.
  2. Expand the Print to listbox and click File.
  3. Set Use Adobe PDF to No.
  4. In the File Path and Name field, type a valid file path and name.
  5. Expand the Printer Definition Table listbox and select a PDT.

Before the Host On-Demand client can use this print method, the Host On-Demand administrator must provide a Printer Definition Table (PDT) (see Creating a PDT file ).

For the file path and name, see Specifying a File Path and Name.

You can also use the File Path and Name field to specify one or more native console commands to be run after the host print job completes (see Running external commands after host print jobs in the online help).

This print method is useful when you do not want to send the print output to a printer immediately. For example:

You must also use this method when you want to send print output from an UNIX, AIX, or Linux workstation to an available network printer. Follow these steps:

  1. Use the File print method to send the output to a file.
  2. From the command prompt, issue the appropriate command to send the file to the network printer. For example, if the name of the file is hprint.000 and the name of the remote printer is prtq1, then you might type:
    lp  -dprtq1  hprint.000
    or
    lp  -Pprtq1  hprint.000

E. File, with Use Adobe PDF set to Yes (does not use a Printer Definition Table)

To select this print method:

  1. Open the Printer Setup window.
  2. Expand the Print to listbox and click File.
  3. Set Use Adobe PDF to Yes.
  4. In the File Path and Name field, type a valid file path and name.

The Host On-Demand client transforms the print output to binary data in Adobe PDF format, and writes the binary data into the specified file. The file can be viewed with Adobe Reader version 4.0 or later.

This print method is useful when you want to transform the data to a portable and easily viewable format.

This method does not require a PDT.

Using the print methods on OS/2

The following table shows the print methods available when the Host On-Demand client is running on an OS/2 platform and summarizes the characteristics associated with each print method:

Print method: Characteristics:
A. Windows Printer, with Use Printer Definition Table set to No
  • Not available on OS/2.
B. Windows Printer, with Use Printer Definition Table set to Yes
  • Not available on OS/2.
C. Printer (always uses a Printer Definition Table)
  • This print method is called Other Printer on Windows platforms.
  • This is the default print method for OS/2.
  • The administrator must provide a Printer Definition Table (PDT).
D. File, with Use Adobe PDF set to No (always uses a Printer Definition Table)
  • The administrator must provide a Printer Definition Table (PDT).
  • Useful if you do not want to send the print output to a printer immediately.
E. File, with Use Adobe PDF set to Yes (does not use a Printer Definition Table)
  • A PDT is not required.
  • The print output is written to the specified file in Adobe PDF format.
The remainder of this subsection describes how to use each print method on the OS/2 platform.
A. Windows Printer, with Use Printer Definition Table set to No

This print method is not available on OS/2.

B. Windows Printer, with Use Printer Definition Table set to Yes

This print method is not available on OS/2.

C. Printer (always uses a Printer Definition Table)

On Windows platforms, this print method is called Other Printer.

This is the default print method for the Host On-Demand client when it is running on an OS/2 platform. To select this print method:

  1. Open the Printer Setup window.
  2. Expand the Print to listbox and click Other Printer.
  3. Expand the Printer Definition Table listbox and select a PDT.

Before the Host On-Demand client can use this print method, the Host On-Demand administrator must provide a Printer Definition Table (PDT) (see Creating a PDT file ).

In the Printer Name field, you can type any one of the following:

D. File, with Use Adobe PDF set to No (always uses a Printer Definition Table)

To select this print method:

  1. Open the Printer Setup window.
  2. Expand the Print to listbox and click File.
  3. Set Use Adobe PDF to No.
  4. In the File Path and Name field, type a valid file path and name.
  5. Expand the Printer Definition Table listbox and select a PDT.

Before the Host On-Demand client can use this print method, the Host On-Demand administrator must provide a Printer Definition Table (PDT) (see Creating a PDT file ).

For the file path and name, see Specifying a File Path and Name.

You can also use the File Path and Name field to specify one or more native console commands to be run after the host print job completes (see Running external commands after host print jobs in the online help).

This print method is useful when you do not want to send the print output to a printer immediately. For example:

E. File, with Use Adobe PDF set to Yes (does not use a Printer Definition Table)

To select this print method:

  1. Open the Printer Setup window.
  2. Expand the Print to listbox and click File.
  3. Set Use Adobe PDF to Yes.
  4. In the File Path and Name field, type a valid file path and name.

The Host On-Demand client transforms the print output to binary data in Adobe PDF format, and writes the binary data into the specified file. The file can be viewed with Adobe Reader version 4.0 or later.

This print method is useful when you want to transform the data to a portable and easily viewable format.

This method does not require a PDT.

Print Technologies

The Host On-Demand host print clients (3270 Printer session and 5250 Printer session) use the following three print technologies (or print "modes"):

The 3270 Display session uses a fourth print technology:

The following table summarizes the relationships between the five print methods described in the preceding sections and the three print technologies used by host print clients:

Print method: Print technology:
Windows Printer, with Use Printer Definition Table set to No Windows Native Printer Interface (WPNI) mode
Windows Printer, with Use Printer Definition Table set to Yes Windows Spooler Interface (WSI) mode
Other Printer or Printer (always uses a Printer Definition Table) Java File Interface (JFI) mode
File, with Use Adobe PDF set to No (always uses a Printer Definition Table) Java File Interface (JFI) mode
File, with Use Adobe PDF set to Yes (does not use a Printer Definition Table). Java File Interface (JFI) mode and libraries for generating Adobe PDF format.

The following subsections describe each of the three print technologies (print "modes")

Windows Native Printer Interface mode

This mode is supported by Host On-Demand Version 6.0 and later versions and is available only on clients running a Windows platform.

In this mode, the Host On-Demand client sends the print data stream to the printer by making Graphics Device Interface (GDI) API calls to the Windows printer driver for the selected printer via the Java Native Interface (JNI).

Because the Host On-Demand client is communicating with the Windows printer driver, this mode is useful:

Because the Host On-Demand client communicates with the Windows printer driver:

The Windows Native Printing mode uses two Windows native library files (hodprint.dll and hodprinterdriver.dll), which are automatically installed to your local file system. The directory where those files are installed varies depending on the Windows platform and the browser you are using.

If you are using Netscape Version 4.x (for example, Version 4.75), Host On-Demand will additionally install the following three Java class files: WinPrint.class, NativePrinter.class, and HODPrinterDriver.class.

Windows Spooler Interface mode

This mode is supported by Host On-Demand Version 6.0 and later versions and is available only on clients running a Windows platform.

In this mode, the Host On-Demand client:

  1. Uses a Printer Definition Table (PDT) to transform the 3270 print data stream to a printer data stream that is meaningful to the selected printer.
  2. Sends the printer data stream to the printer by calling the Windows Spooler Interface API via the Java Native Interface (JNI).

The use of a Printer Definition Table (PDT) often provides greater flexibility than may be available with Windows Native Printer Interface (WPNI) mode, because the PDT can specify printer data stream features that may not be supported by the Windows printer driver.

The Windows Spooler Interface mode uses two Windows native library files (hodprint.dll and hodspoolermode.dll), which are automatically installed to your local file system. The directory where those files are installed varies depending on the Windows platform and the browser you are using.

If you are using Netscape Version 4.x (for example, Version 4.75), Host On-Demand will additionally install the following three Java class files: WinPrint.class, NativePrinter.class, and HODSpoolerMode.class.

Java File Interface mode

This mode is supported on all Host On-Demand client platforms that support host print.

In this mode the Host On-Demand client:

  1. Uses a Printer Definition Table (PDT) to transform the 3270 print data stream to a printer data stream that is meaningful to the printer.
  2. Writes the printer data stream to a printer device (such as LPT1, \\myServer\myPrinter, or /dev/lp0) or to a file.

The use of a Printer Definition Table (PDT) provides great flexibility, because the PDT can specify detailed printer data stream features.

Specifying a File Path and Name

When you select to print to a file in the drop-down list of Print To options in the Printer window, you can type the File Path and Name. 

Creating Adobe PDF Files

3270 printer sessions now include the option to print to Adobe PDF files. This feature allows users to view files in a standard Web browser with the Adobe Acrobat plug-in installed. The Advanced Options panel enables the selection of  paper size, paper orientation, and Adobe PDF fonts.

The following table lists all of the supported paper sizes for Adobe PDF files. The default paper size for US English and Canadian locales is Letter. For all other locales, the default paper size is A4. 

Table 5. Supported Paper Sizes

Name Region Physical Width Physical Height
North American Media Sizes
Number 10 North America 4.125 in. 9.500 in.
Number 9 North America 3.875 in. 8.875 in.
Continuous Sheet (132 columns) North America 11.000 in. 13.200 in.
Continuous Sheet (80 columns) North America 8.000 in. 11.000 in. 
Executive North America 7.250 in. 10.500 in.
Ledger North America 11.000 in. 17.000 in.
Legal  North America 8.500 in. 14.000 in.
Letter North America 8.500 in. 11.000 in. 
Monarch North America 3.875 in. 7.500 in.
ISO/Japanese Media Sizes
A3 ISO/Japan 297.0 mm 420.0 mm
A4 ISO/Japan 210.0 mm 297.0 mm
A5 ISO/Japan 148.0 mm 210.0 mm
B4 (ISO) ISO 250.0 mm 353.0 mm
B4 (JIS) Japan 257.0 mm 364.0 mm
B5 (ISO) ISO 176.0 mm 250.0 mm
B5 (JIS) Japan 182.0 mm 257.0 mm
C5 ISO 162.0 mm 229.0 mm
DL ISO 110.0 mm 220.0 mm

For continuous sheets, the default margin value on all sides (top, bottom, right, and left) is 0. For North American paper (not including continuous sheets), the default margin value is 0.25 inches on all sides. For ISO/Japanese paper, the default margin value is 5 mm on all sides. 

Code pages used in Adobe PDF files

If the specified host code page is not Bidi or DBCS, Host On-Demand uses an internal Windows code page in the generated Adobe PDF file. The following list shows the Windows code pages that are used for specific host code pages:

Since Greek host code page 875 and Estonian host code pages 1122 and 1157 have characters that are not included in the Windows code pages above, the following characters cannot be printed:

Creating a PDT file

Please note the following definitions:

Broadly, the steps in compiling a PDF are as follows:

  1. Start the Printer Definition Table Compiler.
  2. Select a Printer Definition File (PDF).
  3. Click OK to compile the PDT.
  4. The PDT Compiler compiles the PDF file, generates the PDT file, and places the PDT file in a directory on the server.

To deploy a PDT file to the workstation on which the Host On-Demand client is running:

The following subsections describe how to create PDTs in more detail.

More about Printer Definition Files

A printer definition file (PDF) is an ASCII file that contains macro definitions, session parameters, formatting controls, and character definitions. You can edit a PDF with an ASCII text editor to customize it for your printer. Most printers support similar commands for basic functions, but they differ widely in their support for more advanced functions. Several PDFs are provided that should be suitable for most printers, except those that use PostScript and the HP Printing Performance Architecture (PPA).

You can compile and use PDFs from IBM Personal Communications for Host On-Demand. However, not all controls are supported.

Note that there is no connection between the PDFs in Host On-Demand and the Adobe PDF (Portable Document Format) files.

More about Printer Definition Tables

A printer definition table (PDT) is a file that is used to format the data stream that the host application sends. The Host On-Demand emulator converts the data stream from EBCDIC to ASCII (unless there is a passthru command in the data stream), formats the data according to controls specified in the data stream or in the PDT itself, and sends the data to the printer. You can use a simple PDT that contains basic instructions. However, if you want to use some of the newer workstation-printer functions, such as the ability to change fonts or paper-drawers, the PDT must be customized for your printer, and the host application must send the necessary commands. You must, in any case, use a PDT that is suitable for the emulation mode that the printer supports (HP PCL Level 3, IBM PPDS, and so on).

Several generic and specific PDTs are provided with Host On-Demand for both Single-byte Character Set (SBCS) and Double-byte Character Set (DBCS) printers. You can create customized versions of these or you can create entirely new ones. In either case, you need a Printer Definition File (PDF) from which to create a PDT.

Starting the Printer Definition Table Compiler

The compiler is a Java application that runs on a Host On-Demand server or a locally installed client. The compiler does not run on a download client.

When you start the compiler, it presents a graphical interface consisting of two entry fields: one for a PDT name and one for a printer description. A Status and Error Information window also appears. A log file called pdtc.log is created.

On a Windows NT, Windows 2000, or Windows XP server or a Windows client, you can start the compiler through Administration on the Start menu. On other platforms, you must start the compiler with a Java command. Sample command files are provided.

You can also start the compiler in non-graphical mode from a command line.

Locating Predefined Printer Definition Files and Tables

The PDFs and PDTs provided by IBM are installed in the pdfpdt subdirectory of the publish directory on a server (for example, C:\Program Files\IBM\HostOnDemand\HOD\pdfpdt) and in the equivalent subdirectory on a locally installed client ).

PDFs have the extension .pdf, and PDTs have the extension .hodpdt. A number of other PDFs are provided as examples and can be found in the samples\pdf directory of the publish directory (for example, C:\Program Files\IBM\HostOnDemand\HOD\samples\pdf).

For Arabic and Hebrew, prn*.pdf files are provided in the samples\pdf directory. To use one of these prn*.pdf files, copy the file from the samples\pdf directory to the pdfpdt\usrpdf directory, modify the copied file if necessary, and then compile it.

When compiling printer definition files shipped with Host On-Demand that contain Arabic or Hebrew markers, the resulting PDT does not appear in the Print Definition Table drop-down list in the printer properties on non-Hebrew or non-Arabic machines.  Refer to the Host On-Demand Hints and Tips website for detailed information.

Single-byte Character Set (SBCS) PDFs and PDTs

The following PDFs and PDTs are provided specifically for Host On-Demand:

 

basic Basic ASCII text mode
A simple PDF that produces readable output from most printers
LaserPCL HP PCL Level 3 (Laser Printers)
Suitable for most laser printers in PCL mode
LaserPPDS IBM PPDS Level 2
Suitable for most laser printers in PPDS level-2 mode
Proprinter IBM PPDS Level 1 (Proprinter XL, X24, XL24)
Suitable for most printers in PPDS level-1 mode

PDFs contain annotations that explain the purpose of parameters. Each section begins with text that explains how the parameters can be used. For more information, refer to Understanding the Format of Printer Definition Files and Printer Definition File Example (3270).

Thai PDTs and PDFs

When the host code page is Thai (838 or 1160), the following PDFs and PDTs are available:

Thai

basic_thai Basic ASCII text mode
esc_pthai Thai EPSON ESC/P compatible printers
esc_p2thai Thai EPSON ESC/P2 compatible printers
necthai Thai NEC printers

Double-byte Character Set (DBCS) PDFs and PDTs

For DBCS printers, the following PDTs and PDFs are provided:

Japan

basic_dbcs ASCII text mode: A simple PDF that produces readable output from most printers
esc_p Printers based on ESC/P 24-J84: Suitable for most EPSON ESC/P printers
ibm5577 IBM 5577-B02, F02, G02, H02: Appropriate for IBM 5577-series printers
ibm5585 IBM 5585-H01 Printer: Appropriate for IBM 5585 printers and printers based on pages
ibm5587 IBM 5587-G01, H01: Appropriate for IBM 5587 printers (without advanced function)
lips3a4 Printers based on LIPS 3: Appropriate for Canon LIPS printers (A4 size)
lips3b4 Printers based on LIPS 3: Appropriate for Canon LIPS printers (B4 size)

Korean

ibm5577k Korea IBM 5577 printer: Appropriate for IBM 5577 printers
kssm_jo KSSM_jo Printer: Appropriate for "combined" character-code-mode printers
kssm_wan KSSM_wan Printer: Appropriate for "complete" character-code-mode printers
ks_jo KS_jo Printer: Appropriate for "combined" character-code-mode printers
ks_wan KS_wan Printer: Appropriate for "complete" character-code-mode printers

China and Taiwan

esc_pp Simplified Chinese ESC/P Printer: Appropriate for most EPSON ESC/P printers in China
esc_5550 Traditional Chinese ESC/P Printer (5550): Appropriate for most EPSON printers in 5550-character-code mode in Taiwan
esc_big5 Traditional Chinese ESC/P Printer (big-5): Appropriate for most EPSON printers in Big-5-character-code mode in Taiwan
esc_cns Traditional Chinese ESC/P Printer (cns): Appropriate for most EPSON printers in CNS-character-code mode in Taiwan
esc_tca Traditional Chinese ESC/P Printer (tca): Appropriate for most EPSON printers in TCA-character-code mode in Taiwan
ibm5577t Traditional Chinese IBM 5577 Printer: Appropriate for IBM 557x-series printers in Taiwan
ibm5585t Traditional Chinese IBM 5585 Printer: Appropriate for IBM 5585 PAGE printers in Taiwan

 

 

The list of printer definition tables that appears on the Printer page of the session-configuration panel varies according to the Host Code Page that you set on the Connection page. In addition to those PDTs appropriate to the code page, the list includes any PDTs that you have created. If a session is configured for a DBCS code page, but you want to use an SBCS PDT, copy the appropriate PDF to the usrpdf directory and compile it with another name. It will then be a user-created PDT and will appear in the list on the configuration panel.

Supported Printer Emulation Modes

A PDT must be appropriate to the printer-emulation mode you want to use. For SBCS printers, the supported modes are:

For DBCS printers, the supported modes are:

If you are not sure which emulation modes or languages your printer supports, refer to the printer's technical documentation.

In some cases, it may be necessary to change the settings on the printer so that they match the mode for which the PDT is written. Some printers can switch between modes automatically or have software that enables you to change the mode. It is important to refer to the printer documentation to decide which PDT to use and how to set the correct mode on the printer. The printer manufacturer's Web site is another valuable source of information.

 

  • Most laser printers can use HP PCL level 3. Level-3 commands are understood by printers that support newer levels.
  • All printers that provide the PPDS mode support PPDS level 1.
  • Printers that support later levels of PPDS (3 or 4) will work with the LaserPPDS PDT.
  • Proprinter-compatible printers and printers that support only PPDS level 1 cannot switch code-pages, so use the Proprinter PDT for these printers.
  • Try basic ASCII text mode if your printer does not allow one of the other modes supported by Host On-Demand. However, if you use this mode, the commands that are unique to your printer will not be available.
  • PDT mode does not support PostScript; however, the Native Printing mode does support PostScript though the appropriate PostScript printer driver.

Creating a Printer Definition Table (PDT) (3270)

If you are not able to use any of the IBM-provided PDTs, you can create one. However, you cannot create a PDT directly. You must first create a printer definition file (PDF), and then compile it to create a PDT.

Creating a Printer Definition File

You can create a new PDF either by typing it or by customizing one of the IBM-supplied PDFs. In either case, use an ASCII editor, because word-processing programs sometimes introduce spurious codes into the text.

Save the PDFs you create in the pdfpdt\usrpdf subdirectory of the publish directory of the Host On-Demand server (for example, C:\Program Files\IBM\HostOnDemand\HOD\pdfpdt\usrpdf) or in the equivalent directory on a locally installed client.

Before you attempt to create a PDF, you should understand its structure and the types of statements that can be included. See Understanding the Format of Printer Definition Files for help.

You should have the technical documentation for your printer available so you can look up the needed control codes. There are many variations from printer to printer.

 

If you want to customize one of the IBM-supplied PDFs to create your own, copy it from the pdfpdt directory to the pdfpdt\usrpdf subdirectory, modify it, and then compile it.

 

Using the Printer Definition Table Compiler

When you have created or modified a PDF, use the Printer Definition Table Compiler to create a PDT. You can run the compiler in graphical or nongraphical mode. PDTs that you create have names in the format usr*.hodpdt, where * is the name of the PDF that you compiled.

Printer Definition Table Description

Every PDT must have a unique description because this identifies the PDT when you configure a printer session. In graphical mode, the compiler checks that a unique description has been assigned. If it finds that a PDT with the same description already exists, it stops compiling and displays an error message. You can then  change the description and click OK to start again. In nongraphical mode, the compiler does not check that the description is unique.

Running the Compiler in Graphical Mode

The graphical mode lets you compile PDFs interactively. A log file called pdtc.log is saved in the pdfpdt\usrpdf directory.

Compiling a PDT on a Windows workstation or server

To compile a printer definition table on a Windows workstation or server:

  1. Create a PDF and save it in the pdfpdt\usrpdf directory (for example, C:\Program Files\IBM\HostOnDemand\HOD\pdfpdt\usrpdf).
  2. Click Start > Programs > IBM WebSphere Host On-Demand > Administration > Printer Definition Table Compiler.
  3. Select the printer definition file from the pull-down list.
  4. Type a description for the printer definition table that you are going to create. A description is essential because it serves to identify the PDT when you configure a printer session.
    If the description is not unique, an error message appears.
  5. Click OK. The PDT is created in the pdfpdt directory. Status and error information appears at the bottom of the window and in the log file. If there are errors in the PDF, correct them and then recompile.

    If you want to compile other PDFs, repeat steps 3 - 5.

  6. Click Exit when you have finished.

Compiling a PDT on an AIX, OS/2, or UNIX server

  1. Copy the PdtCompilerApplication-AIX (or UNIX, or OS/2) file from the lib/samples/PdtCompiler directory in the Host On-Demand install directory (for example, from /opt/IBM/HostOnDemand/lib/samples/PdtCompiler) to a user directory (for example, /usr/local).
  2. Modify the three variables in the PdtCompilerApplication-AIX file to match the installed system. Use the directions provided in the command file.
  3. For UNIX servers only, change the file permissions for PdtCompilerApplication-UNIX to executable.
  4. Run the PdtCompilerApplication-AIX (or UNIX, or OS2).
  5. Select a PDF file from the pull-down and use it or modify it.
  6. Enter a PDT description. This is name that Host On-Demand will use to identify this PDT.
  7. Click OK.
  8. Copy the PDF file to the pdfpdt/usrpdf directory. You may need to create the usrpdf directory.

Compiling a PDT on an iSeries server

To compile a printer definition table on an iSeries server, do the following:

  1. Copy the PdtCompilerApplication-OS400 file from the lib/samples/PdtCompiler directory (for example, from /QIBM/ProdData/hostondemand/lib/samples/PdtCompiler) to your work directory
  2. Edit the file to reflect your environment.
  3. Run the qsh command to start a shell session.
  4. Run the command file that you edited in step 2.

The compiler runs in nongraphical mode.

Compiling a PDT on a System/390

To compile a printer definition table on a System/390 server, do the following:

  1. Save the PDFs created or modified in the pdfpdt/usrpdf subdirectory of the publish directory (for example, /usr/lpp/HOD/hostondemand/HOD/pdfpdt/usrpdf). Create the directory if it does not exist. 
  2. Edit the PdtCompilerApplication-S390 found in /usr/lpp/HOD/hostondemand/HOD/samples/PdtCompilerCommandFiles. 
  1. Verify the JAVA_ENGINE variable has the correct Java path.  
  2. Modify the NONGUI_COMMAND line for the .pdf name and description. 
  1. Run the PdtCompilerApplication-S390 command. 

The compiler runs in nongraphical mode.

Compiling a PDT on other platforms

On other platforms, including Novell Netware, you start the compiler with a command. To make this easier, sample command files are provided in the pdtcompilercommandfiles directory.

 

  1. Copy the sample command file to a proper directory in your environment.
  2. Edit the file to reflect your environment.
  3. Run the command.
  4. Select a printer definition file from the pull-down list.
  5. Type a description for the printer definition table that you are going to create.
    If the description is not unique, an error message appears.
  6. Click OK. The PDT is created in the pdfpdt directory. Status and error information appears at the bottom of the window and in the log file. If there are errors in the PDF, correct them and then recompile.

    If you want to compile other PDFs, repeat this process.

  7. Click Exit.

 

Status and Error Information

The bottom window of the graphical interface displays status and error information. When you use the graphical interface, a history of each compiler run is saved in pdtc.log in the usrpdf subdirectory. The log is overwritten each time you start the compiler.

In addition to verifying that the PDT description is unique, the compiler checks that the syntax of the PDF is correct. Errors found are displayed in the Status and Error Information window and saved in the log.

Running the Compiler in Nongraphical Mode

This section does not apply to zOS.

If you want to compile several PDTs at one time, you can run the compiler in nongraphical batch mode by creating a command file and including multiple instances of the command that runs the compiler.

You can modify a version of the appropriate sample command-file provided in the pdtcompilercommandfiles directory; add any of the parameters listed below as necessary. If you compile several PDTs at one time, use the -NOINDEX parameter for each instance except the last, for which you should use the INDEX parameter. Create an index only after you have done the other compilations.

-NOINDEX
Causes the compiler to run in nongraphical mode and does not generate an index. This parameter is not recognized in graphical mode.
INDEX
Causes the compiler to run in nongraphical mode and to create an index, which lets Host On-Demand keep track of PDTs. When you use INDEX, you may not use any other options. Note that INDEX must not have a dash ( - ) before it.
-PATH pathSpecification
Causes the compiler to look for PDFs in the [pathSpecification]\pdfpdt directory.
-ENCOD encodingSpecification
Causes the PDF to be interpreted with the Java encoding-table specified rather than with the default table. You should use this if you are running the compiler on MVS and the MVS system uses an encoding-table different from that in which the PDF was created.

The command to invoke the compiler in nongraphical mode is:

   INSTALL_PATH/lib/samples/PdtCompiler/PdtCompilerApplication-XXX
   [-NOINDEX] | [-PATH pathSpecification] | [-ENCOD encodingSpecification] [PDF_file_name PrinterDescription]
where XXX is the appropriate suffix for compiler application file for your platform.
  • If the PDF_file_name is present, the PrinterDescription must also be present.
  • If the PDF_file_name is not present, the compiler runs in graphical mode.

After you have compiled your PDT(s), you must run the compiler again to create an index, which is essential. The command to invoke the compiler to create only an index is:

   INSTALL_PATH/lib/samples/PdtCompiler/PdtCompilerApplication-XXX INDEX
where XXX is the appropriate suffix for compiler application file for your platform.

Compiled printer definition tables are saved in the pdfpdt directory (for example, in C:\Program Files\IBM\HostOnDemand\HOD\pdfpdt).

In nongraphical mode, compiler messages are displayed in English only.


Understanding the Format of Printer Definition Files (3270)

A PDF contains three main sections:

Macro Definitions

This section of a PDF contains macros that consist of a single mnemonic that represents a control code or a sequence of control codes. A mnemonic simplifies the definition of control sequences for PC printers and makes it easier to read the information in the PDF. The PDFs provided by IBM include many macros, but you can define also your own.

The following table shows the structure of a macro definition statement. A macro definition is composed of four parts:

1 2 3 4
name EQU PC printer control codes Comments

For example:

   FFF    EQU   0C               /* Form Feed */

Part 1 is the mnemonic or macro name. This must be three characters long and must not begin with a number. It is helpful to define a meaningful mnemonic, such as P17 for 17.1 pitch.

Part 2, stands for "equates to" and must be coded as EQU.

Part 3, the hexadecimal control code, must be defined specifically for the printer you intend to use, because printer manufacturers use different codes for the same function. For example, the IBM LaserPrinter uses control codes defined by the IBM Personal Printer Data Stream (PPDS), whereas Hewlett-Packard printers use control codes defined by the Hewlett-Packard Printer Control Language (PCL). These control codes are defined in the reference manual for the printer (which you might need to order).

Some printer manuals describe control sequences as a string of ASCII symbols, such as ESC W 1. Others use hexadecimal numbers, such as 1B 57 01. Still others use decimal values, such as 027 087 001. The PDT compiler accepts any of these formats.

The control codes in the macro definitions section can be any of the following:

If the control code part of a macro (part 3) is blank, it is interpreted as a null string. If a code is defined more than once in the file, the last definition is used.

Part 4, the comment section, must be enclosed by /* and */. Comments can be included at any point in the file and are ignored by the compiler.

The following macro definition example is for a printer that supports IBM PPDS:

CRR EQU 0D             /* Carriage Return                             */
SEL EQU 11             /* Select Printer                              */
P10 EQU 12             /* 10 Pitch (characters/inch)                  */
P12 EQU 1B 3A          /* 12 Pitch (characters/inch)                  */
P05 EQU 1B 57 01       /* 5 Pitch (characters/inch), double wide      */
CDW EQU 1B 57 00       /* Cancel Double Wide                          */
CDL EQU 14             /* Cancel Double Wide line                     */
CS2 EQU 1B 36          /* Select character set 2                      */
SVT EQU 1B 42          /* Set vertical tabs                           */
CAT EQU 1B 52          /* Cancel all tabs (clears VT)                 */
SFL EQU 1B 43 00       /* Set Form Length                             */
SDS EQU 1B 47          /* Start Double Strike                         */
CDS EQU 1B 48          /* Cancel Double Strike                        */
SUL EQU 1B 2D 01       /* Start Underline                             */
CUL EQU 1B 2D 00       /* Cancel Underline                            */
CP8 EQU 1B 5B 54 04 00 00 00 03 52     /* select code page 850        */
CP4 EQU 1B 5B 54 04 00 00 00 01 B5     /* select code page 437        */
LL8 EQU 1B 41 09 1B 32 /* Set line length 8 lines/inch                */

Here is an example of how a macro might be used.

The host data stream contains a Word Underscore (WUS) command (LU1 SCS command 23). This indicates that the preceding word or string must be underlined. Host On-Demand converts the WUS command into START_HIGHLIGHT_UNDERLINE before the word and END_HIGHLIGHT_UNDERLINE after the word.

These controls are defined as macros SUL and CUL in the Control Codes section of the PDF:

     START_HIGHLIGHT_UNDERLINE=SUL
     END_HIGHLIGHT_UNDERLINE=CUL
These macros are defined in the Macros section (see above).

 

When Host On-Demand receives the WUS command, it looks up the control codes and then looks up the macros. It finally sends the escape sequences defined in the macros to the printer. If the host sent a WUS command following the string "This is underscored", the following codes would be sent to the printer:

     54686973   20    6973   20    1B2D01   756E64657273636F726564   1B2D00

      T h i s  space   i s  space    SUL     u n d e r s c o r e d     CUL

The printed output is: "This is underscored"

Refer to Appendix A. Printer Data Stream Information for more information.


Formatting Controls

This section describes the session parameters, control codes, and highlighting specifications that can be included in a PDF.

Field Names and Parameter Definitions

The parameter to the left of the equal sign is a keyword and must be coded exactly as shown. The keyword defines a statement. The value to the right of the equal sign can be a word, a macro, a control code, a decimal number, or a hexadecimal number (sometimes referred to as a parameter).

Session Parameters

Session parameters determine the way in which the output is formatted. The session parameters in a PDF are related to the parameters in the Advanced Options panel of a session configuration, though there are many more options in a PDF than in the panel. If you do not change the defaults in the configuration panel, the values for the equivalent parameters in the PDT are used. Any change you make in the panel overrides the value in the PDT. Refer to Appendix C. Advanced Configuration Options for the list of session parameters that can be set in the panel.

The following table lists the field names and meanings of the Session Parameters.

Table 1. Session Parameters

Field Name Value or Remarks
ASCII_PASSTHRU? YES/NO. For LU1 only. Host data sent without any translation. For host applications that generate PC printer control codes directly. See below for more information.
EBCDIC_PASSTHRU? YES/NO. For LU1 only. SCS commands ignored and data sent to the printer after EBCDIC-to-ASCII translation. See below for more information.
MAXIMUM_PAGE_LENGTH 001 to 255. Number of lines that could print on a sheet of paper. For example, 66 means an 11-inch sheet at 6 lines per inch. If you change this value, you must change the value in the "SET_PAGE_LENGTH=SFL value" control code to be the same.
MAXIMUM_PRINT_POSITION 001 to 255. Number of characters that could fit on a line.
DEFAULT_CPI? 010, 012, 017. Default characters per inch.
DEFAULT_LPI? 002, 003, 004, 006, 008, 010. Default lines per inch.
COMPRESS_LINE_SPACING? YES/NO. For LU3 only. Determines whether a line is to be printed if all characters on that line are nulls or blanks.
FORM_FEED_ANY_POSITION? YES/NO. For LU3 only. Determines whether a form feed is to be active in any position. If NO, a form feed will be active only in the following positions:
  • First print position of the buffer
  • After a valid new-line operation
  • First print position of a line
OVERRIDE_FORMATTED_PRINT? YES/NO. For LU3 Only. Specifies whether to print null characters as blanks.
HORIZONTAL_PEL Number of pels in one inch (X-direction).
VERTICAL_PEL Number of pels in one inch (Y-direction).
LINE_SPACING_RATIO Integer value equivalent to one inch. Used as the unit for SET_VARIABLE_LINE_DENSITY. 72 for PPDS, 4 8 for PCL.
TOP_MARGIN Decimal value. Default is top of sheet.
LEFT_MARGIN Decimal value. Default is left edge of sheet.
AUTO_NEWLINE_AT_MAX_POS? YES/NO. Specifies whether CR and LF are inserted at MPP.
IGNORE_FORM_FEED_AT_FIRST_POS? YES/NO. Specifies whether FF at the first position is ignored.
FORM_FEED_TAKES_POSITION? YES/NO. For LU3 only. Specifies whether FF occupies a space.
NO_AUTO_NL_IF_CR_AT_MPP_PLUS_1? YES/NO. For LU3 only. Specifies whether auto-new-line is suppressed when CR is at MPP+1. When this is set to YES, auto-new-line is suppressed.
NO_AUTO_NL_IF_NL_AT_MPP_PLUS_1? YES/NO. For LU3 only. Specifies whether auto-new-line is suppressed when NL is at MPP+1. When this is set to YES, auto-new-line is suppressed.
INTERV_REQ_TIMER 000 TO 255. Determines the delay before an "intervention required" message is sent. A value of 000 disables the timer. A value below 011 sets an interval of 10 seconds.
FORM_FEED_AT_END_OF_JOB NONE/ALWAYS/CONDITIONAL. Specifies how form feed is inserted at the end of the job. When this is set to NONE, no form feed is inserted at the end of the job. When this is set to ALWAYS, form feed is always inserted at the end of the job. When this is set to CONDITIONAL, form feed is inserted only when a job was not ended at the page boundary. The default value is CONDITIONAL.

ASCII_PASSTHRU? Keyword Support (LU1 Only)

If you add the following line to a PDF, Host On-Demand sends host data to the printer without translation:

     ASCII_PASSTHRU? = YES

This option is for host applications that generate PC printer control codes directly.

  1. Even if ASCII_PASSTHRU? is set, control codes defined in the START_JOB and END_JOB sections of the PDF are sent to the printer at the start and end of a print job respectively. Remove them, if needed.
  2.  

  3. If ASCII_PASSTHRU? is set, all character definition lines, such as EBCDIC_xx, are ignored.
  4.  

  5. If both ASCII_PASSTHRU? and EBCDIC_PASSTHRU? are set, ASCII_PASSTHRU? takes precedence.

EBCDIC_PASSTHRU? Keyword Support (LU1 Only)

If you add the following line to a PDF, Host On-Demand ignores all SCS commands and sends only data to the printer after EBCDIC-to-ASCII translation:

     EBCDIC_PASSTHRU? = YES

 

  1. If EBCDIC_PASSTHRU? is set, control codes defined in the START_JOB and END_JOB sections of the PDF are sent to the printer at the start and the end of a print job respectively. Remove them, if needed.
  2. If both ASCII_PASSTHRU? and EBCDIC_PASSTHRU? are set, ASCII_PASSTHRU? takes precedence.

The default EBCDIC-to-ASCII translation table used for U.S. English host code page 037 is as follows:

     Hex    0 1  2 3  4 5  6 7  8 9  A B  C D  E F
     ---------------------------------------------
       0 | 2020 2020 2020 2020 2020 2020 2020 2020
      10 | 2020 2020 2020 2020 2020 2020 2020 2020
      20 | 2020 2020 2020 2020 2020 2020 2020 2020
      30 | 2020 2020 2020 2020 2020 2020 2020 2020
      40 | 20FF 8384 85A0 C686 87A4 BD2E 3C28 2B7C
      50 | 2682 8889 8AA1 8C8B 8DE1 2124 2A29 3BAA
      60 | 2D2F B68E B7B5 C78F 80A5 DD2C 255F 3E3F
      70 | 9B90 D2D3 D4D6 D7D8 DE60 3A23 4027 3D22
      80 | 9D61 6263 6465 6667 6869 AEAF D0EC E7F1
      90 | F86A 6B6C 6D6E 6F70 7172 A6A7 91F7 92CF
      A0 | E67E 7374 7576 7778 797A ADA8 D1ED E8A9
      B0 | 5E9C BEFA B8F5 F4AC ABF3 5B5D EEF9 EF9E
      C0 | 7B41 4243 4445 4647 4849 F093 9495 A2E4
      D0 | 7D4A 4B4C 4D4E 4F50 5152 FB96 8197 A398
      E0 | 5CF6 5354 5556 5758 595A FDE2 99E3 E0E5
      F0 | 3031 3233 3435 3637 3839 FCEA 9AEB E9FF

You can modify this code page by using EBCDIC_xx keywords. Note that the EBCDIC_PASSTHRU? line must precede any EBCDIC_xx lines in a PDF because Host On-Demand re-initializes the EBCDIC-to-ASCII translation table when EBCDIC_PASSTHRU? is set.


Control Codes

The control codes section of a PDF defines which ASCII escape sequence is sent to the printer when a host control code is received. The escape sequence varies from printer to printer. The PDF must be written specifically for the emulation mode you use.

Control Codes used for both SBCS and DBCS Languages

The following table lists the field names and meanings of control codes that are used for both SBCS languages and DBCS languages.

Table 2. Control Codes

Field name Value or remarks
SET_AUTO_PERFORATION_SKIP Sets the number of lines needed to skip over the perforation between pages
PAGE_LENGTH_TYPE?
  • LINE (= number of lines)
  • INCH (= number of inches)
  • 6INCH (= increments of 1/6 inch)
Defines the unit to be used in SET_PAGE_LENGTH
SET_VARIABLE_LINE_DENSITY Sets the line spacing. Uses the unit defined in the LINE_SPACING_RATIO field (a session parameter)
START_JOB Sets control codes to be sent to a printer at the start of a job
END_JOB Sets control codes to be sent to a printer at the end of a job
BACKSPACE Backspace control code
BEL Bell control code
CARRIAGE_RETURN Carriage return control code
NEW_LINE New line (CR/LF) control code
LINE_FEED Line feed control code
FORM_FEED Form feed (FF) control code
HORIZONTAL_TAB Horizontal tab control code
VERTICAL_TAB Vertical tab control code
DESELECT Device control 3 control code
DUP Character used to print the DUP order (*)
FIELD_MARK Character used to print the FIELD MARK order (;)
SET_HORIZONTAL_TABS Horizontal tabs (column numbers)
SET_VERTICAL_TABS Vertical tabs (line numbers)
SET_HORIZONTAL_MARGINS Right and left margins (column numbers)
SET_PAGE_LENGTH The page length as a multiple of the unit defined in PAGE_LENGTH_TYPE
SET_2_LINES_PER_INCH Line-spacing definition (2LPI)
SET_3_LINES_PER_INCH Line-spacing definition (3LPI)
SET_4_LINES_PER_INCH Line-spacing definition (4LPI)
SET_6_LINES_PER_INCH Line-spacing definition (6LPI)
SET_8_LINES_PER_INCH Line-spacing definition (8LPI)
SET_10_LINES_PER_INCH Line-spacing definition (10LPI)
SET_10_CHARACTERS_PER_INCH Character-pitch definition (10CPI)
SET_12_CHARACTERS_PER_INCH Character-pitch definition (12CPI)
SET_17_CHARACTERS_PER_INCH Character-pitch definition (17.1CPI)
FORWARD_HORIZONTAL_SKIP Defines the unit to be used in the HORIZONTAL_PEL session parameter
FORWARD_VERTICAL_STEP_FEED Defines the unit to be used in the VERTICAL_PEL session parameter
START_HIGHLIGHT_INTENSE Highlight printing (double strike) start
END_HIGHLIGHT_INTENSE Highlight printing (double strike) end
START_HIGHLIGHT_UNDERLINE Underline start
END_HIGHLIGHT_UNDERLINE Underline end
START_HIGHLIGHT_REVERSE_VIDEO Reverse video start
END_HIGHLIGHT_REVERSE_VIDEO Reverse video end
START_HIGHLIGHT_BLINK Blink start
END_HIGHLIGHT_BLINK Blink end
START_DOUBLE_WIDTH_CHARACTER Double-width characters start
END_DOUBLE_WIDTH_CHARACTER Double-width characters end
CUSTOM_CONTROL_CODES? See Using custom control codes (LU1 and LU3).
CUSTOM_CONTROL_CODES_HEADER See Using custom control codes (LU1 and LU3).
CUSTOM_CONTROL_CODES_LENGTH See Using custom control codes (LU1 and LU3).
CUSTOM_CONTROL_CODES_TRAILER See Using custom control codes (LU1 and LU3).

START_JOB and END_JOB

The control codes associated with START_JOB are sent at the start of each host print job. The control codes associated with END_JOB are sent at the end of each job.

Another application or a print job from another user might leave the printer in a mode that does not suit the job you want to print (for example, portrait orientation and Courier font). Set all printer options to a known or desired state at the beginning of each job using START_JOB. Similarly, because several users and applications share the printer, reset the printer to a known state at the end of each job using END_JOB.

For example:

     START_JOB=SEL CDW CDL CUL CDS CP8 CS2 SLO
     END_JOB=CAT CDW CDL CUL CDS CP4 SPO

In this example, the SLO macro is included in the START_JOB statement and the SPO macro is included in the END_JOB statement. The macros are coded as follows:

     SLO EQU 1B 6C     /* Set Landscape Orientation */
     SPO EQU 1B 6B     /* Set Portrait Orientation  */

The result is that the START_JOB statement sends a command to print the job in landscape orientation. The END_JOB statement sends a command to reset the printer to portrait orientation at the end of the job.

SET_VARIABLE_LINE_DENSITY

Use the SET_VARIABLE_LINE_DENSITY statement in combination with the lines-per-inch option in the Advanced Options panel of the session configuration.

The PDT substitutes the value set in the lines-per-inch field, divided into the LINE_SPACING_RATIO (72 for PPDS, 48 for PCL), for the value keyword in the SET_VARIABLE_LINE_DENSITY statement. The format of the PPDS command requires the result in binary form. The format of the PCL format requires the result in decimal (ASCII) form. For PPDS, the statement is:

     SET_VARIABLE_LINE_DENSITY=ESC A value ESC 2
If lines-per-inch is set to 8, the SET_VARIABLE_LINE_DENSITY parameter is:
     SET_VARIABLE_LINE_DENSITY=ESC A 09 ESC 2
where 09 is the result of 72/8. The control code sent to the printer to set the line density (spacing) is:
     1B    41    09    1B    32
    (ESC    A    09    ESC    2)
If SET_VARIABLE_LINE_DENSITY does not have a value, the value of the SET_(n)_LINES_PER_INCH statement is used.

 

CHARACTER_PITCH

On most printers, the default pitch is 10 characters per inch. This is usually coded in the PDF as:

SET_10_CHARACTERS_PER_INCH=P10

where P10 is coded in the macro definition section as:

P10 EQU 12     /* 12 is the printer control code for 10 pitch /*

 

REVERSE_VIDEO and BLINK

The reverse-video and blink codes do not have specified values because printers do not use them. You can use them to send any command you want to the printer by defining a macro, specifying the macro as the value for one of these codes, and sending the code (for example, START_HIGHLIGHT_BLINK) in the host data stream.

Using Custom Control Codes (LU1 and LU3)

Host On-Demand supports custom control codes in 3270 Printer LU1 sessions and in 3270 Printer LU3 sessions. (Host On-Demand does not support custom control codes for 5250 Printer sessions).

A custom control code is a pair of EBCDIC characters that Host On-Demand translates into a hexadecimal byte. Each member of the EBCDIC pair must be either in the range F0-F9 (representing '0'-'9'), or in the range C1-C6 (representing 'A'-'F'), or in the range 81-86 (representing 'a'-'f'). The first member of the pair represents the high nibble of the hexadecimal byte. The second member of the pair represents the low nibble of the hexadecimal byte. For example, the custom control code 81 f0 is translated into the hexadecimal byte a0.

Note: In fact, the translation is in two steps:

  1. Host On-Demand converts an EBCDIC pair to an ASCII pair. For example, EBCDIC 81 f0 is converted to ASCII 61 30.
  2. Host On-Demand translates the ASCII pair to a hexadecimal byte. For example, ASCII 61 30 is translated to hexadecimal a0.
For the EBCDIC-to-ASCII conversion, Host On-Demand uses the current host code page and the current local code page. For virtually all code pages: However, if the EBCDIC-to-ASCII conversion is different from the above, either because of the host code page, or because of the local code page, or because of a custom PDT table, then you must use the EBCIDIC control codes that convert to the proper ASCII characters. (For example, if you want to create a hexadecimal 1b, then you need to specify the two EBCDIC characters that translate to ASCII 31 62.)

In the LU1 or LU3 print data stream, custom control codes must occur inside a custom control code block (which is discussed later in this section). Any number of custom control code blocks can occur in a print data stream. Each custom control code block can contain one or more custom control codes (that is, one or more pairs of EBCDIC characters).

Notice the following:

Control codes

The control codes used to manage custom control codes are:

The control code CUSTOM_CONTROL_CODES? is used to enable or disable custom control codes:

The control code CUSTOM_CONTROL_CODES_HEADER, when it appears in the LU1 or LU3 print data stream, signals the beginning of a custom control code block. You must define this control code in the control codes section of your PDF file, setting it to some macro value or to some series of literal values. For example,

CUSTOM_CONTROL_CODES_HEADER=6c 6c

The control code CUSTOM_CONTROL_CODES_TRAILER is used only in header-trailer mode (see below). This control code, when it appears in the LU1 or LU3 print data stream after a CUSTOM_CONTROL_CODES_HEADER, signals the end of a custom control code block. You must define this control code in the control codes section of your PDF file, setting it to some macro value or to some series of literal values. For example,

CUSTOM_CONTROL_CODES_TRAILER=6c 6c
The value of the trailer can be the same as the value of the header, or different from the value of the header. Often it is convenient to assign the same value to the header and the trailer.

The control code CUSTOM_CONTROL_CODES_LENGTH is used only in header-length mode (see below). This control code does not appear in the LU1 or LU3 print data stream. Instead, it defines the fixed number of custom control codes (EBCDIC pairs) that occur in every custom control code block in the print data stream. You must define this control code in the control codes section of your PDF file, setting it to some macro value or to some series of literal values. For example:

CUSTOM_CONTROL_CODES_LENGTH=1
The above definition of CUSTOM_CONTROL_CODES_LENGTH states that each custom control code block occurring in the print data stream contains one custom control code (one pair of EBCDIC characters).
Modes

Within a single LU1 or LU3 print data stream, you can use custom control codes either in header-trailer mode or in header-length mode. You cannot use both modes in the same print data stream.

Header-trailer mode

In header-trailer mode, a custom control code block consists of:

You must have Host On-Demand use header-trailer mode when the print data stream contains custom control code blocks of different lengths. For example, you must have Host On-Demand use header-trailer mode if the print data stream contains some custom control code blocks containing one control code (1 EBCDIC pair) and other custom control code blocks containing two control codes (2 EBCDIC pairs).

To indicate that you want Host On-Demand to use header-trailer mode, define the CUSTOM_CONTROL_CODES_TRAILER in the control codes section of your PDF file. Here is an example of how to define the relevant control codes in your PDF file when you want to use header-trailer mode:

CUSTOM_CONTROL_CODES?=YES
CUSTOM_CONTROL_CODES_HEADER=6c 6c
CUSTOM_CONTROL_CODES_TRAILER=6c 6c
Do not define the CUSTOM_CONTROL_CODES_LENGTH control code. Host On-Demand ignores this control code when you define CUSTOM_CONTROL_CODES_TRAILER.

Here is an example of a custom control code block that Host On-Demand could process using the above definitions.

6c 6c f1 82 f1 83 6c 6c
Host On-Demand processes these characters as follows:
  1. When it encounters the header 6c 6c, Host On-Demand recognizes that it must process subsequent pairs as custom control codes.
  2. Host On-Demand converts EBCDIC f1 82 to hexadecimal 1b, and then sends this hexadecimal 1b to the print destination.
  3. Host On-Demand converts EBCDIC f1 83 to hexadecimal 1c, and then sends this hexadecimal 1c to the print destination.
  4. When it encounters the trailer 6c 6c, Host On-Demand recognizes that it has reached the end of the custom control code block.

Additional rules for header-trailer mode:

Header-length mode

In header-length mode, a custom control code block consists of:

You can have Host On-Demand use header-length mode only when the print data stream contains custom control code blocks all of the same length. For example, you can have Host On-Demand use header-length mode if the print data stream includes only custom control code blocks that contain two control codes (2 EBCDIC pairs).

To indicate that you want Host On-Demand to use header-length mode, define the CUSTOM_CONTROL_CODES_LENGTH in the control codes section of your PDF file. Here is an example of how to define the relevant control codes in your PDF file when you want to use header-length mode:

CUSTOM_CONTROL_CODES?=YES
CUSTOM_CONTROL_CODES_HEADER=5f 5f
CUSTOM_CONTROL_CODES_LENGTH=2
Please notice:

Here is an example of a custom control code block that Host On-Demand could process using the above definitions.

5f 5f f1 82 f1 84
Host On-Demand processes these characters as follows:
  1. When it encounters the header 5f 5f, Host On-Demand recognizes that it must process subsequent pairs as custom control codes.
  2. Host On-Demand converts EBCDIC f1 82 to hexadecimal 1b, and then sends this hexadecimal 1b to the print destination.
  3. Host On-Demand converts EBCDIC f1 84 to hexadecimal 1d, and then sends this hexadecimal 1d to the print destination.
  4. Having processed two control codes (two EBCDIC pairs), Host On-Demand recognizes that it has reached the end of the custom control code block.

Additional rules for header-length mode:

Additional Control Codes for DBCS

The following table lists the field names and meanings of the DBCS-specific Control Codes. Refer to Code Pages Supported in Host On-Demand for the complete list of code pages.

Table 3. Additional Control Codes for DBCS

Field name Value or remarks
START_LIPS_GRID Start grid (Canon LIPS printers)
END_LIPS_GRID End grid (Canon LIPS printers)
LIPS_IMAGE Send image data (Canon LIPS printers)
IMAGE_TRANSMISSION Image data setup (vertical 24-dot image)
KANJI_CODE?
  • Japanese - JIS, SHIFT_JIS
  • Traditional Chinese - BIG5, TCA, IBM5550, CNS
  • Korean - KS_COMBINE, KS_COMPLETE, KSSM_COMBINE, KSSM_COMPLETE
ZENKAKU_SPACE The size (adjustment unit) of a user-defined character or SBCS character
SBCS_FONT_LOAD Load a SBCS user-defined character
DBCS_FONT_LOAD Load a DBCS user-defined character
SET_LOCAL_FONT Set a font set of user-defined characters. Remove this field when user-defined characters are not loaded to a printer
RESET_LOCAL_FONT Reset a font set of user-defined characters. Remove this field when user-defined characters are not loaded to a printer