As you develop a HATS project, you can establish a print session for the associated host application. When the HATS application is running in a production environment, a user of the application can print data or display data that is formatted for printing. Print support settings only apply to the default HATS connection.
When interacting directly with a host application, a user activates a physical printer to print data from the application. When interacting with a HATS application, the user does not activate a physical printer. Rather, a print file is generated, which can be displayed by the user . The print file can also be printed.
This chapter describes the process for enabling print support in your HATS project and for using print support in the HATS Toolkit environment and in the runtime environment for deployed applications.
Before setting up print support for your HATS project, make sure that you, or the system administrator, have performed the following configuration for the host print session:
Refer to the documentation for your 3270 host software for details on how to perform these steps.
For print support to be available for your project, you must obtain the host name and the port number for the Telnet server from the system administrator. Enter these values when you define the connection settings for your project.
To define print support for 3270E connections, take the following steps:
or
Direct to default Windows printer RCP-only
When a user of the HATS application issues a command to print files, the host application sends a print job to the printer LU and the HATS runtime converts the print job to the format configured for the connection. Once the file is formatted, the user can click View Print Jobs to see a list of queued print jobs. For Web applications this is a button on the application keypad. For rich client applications it is an item on the pop-up menu in the Applications view.
Jobs in the queue can be opened or deleted by clicking the appropriate icons. For example, if open is selected for a PDF file and a viewer program is installed, such as Adobe Acrobat, the viewer program will open with the specified file. The file can be printed or saved at this point. If for example a PDF viewer is not installed, the user is prompted to save the file (as a .pdf file). The saved file can be opened from another system that has a PDF viewer program installed.
The Host On-Demand PDT compiler is supplied as a convenience for users who need to create new Host On-Demand Printer Definition Table (PDT) files for 3270E host printing. PDT files are not typically needed, but can be used if necessary to create binary print output files for specific non-Windows customized printer types. PDT files are created by first creating or modifying a source Printer Definition File (PDF) and then compiling it into a binary PDT file. PDT files are not used for printing to Windows printers.
To create a new PDT file, copy your source PDF into the <RationalSDP_install_directory>\hats\PDT\pdfpdt\usrpdf\ directory. A collection of sample source PDFs is provided in this directory. Unzip the sample PDFs into the usrpdf directory to modify or compile them. Open a command prompt to the <RationalSDP_install_directory>\hats\PDT\ directory and run the pdtcom.bat command. The Compile a Printer Definition Table window opens. In this window, select your source file from the drop-down box, enter a description, and click the OK button to compile it into a PDT file. The compiled PDT file is stored in the <RationalSDP_install_directory>\hats\PDT\pdfpdt\ directory. The file extension of the compiled PDT file is .hodpdt.
Copy the compiled PDT file into a folder, for example, MyPDT, in the root of the .ear project for your HATS Web application, or in the root of the HATS RCP Runtime Extension project for your HATS rich client project, or into a folder within the WEB-INF folder for your HATS portlet project.
The compiled PDT file is configured to HATS on the Printing tab of the connection editor for the default connection. In the Initialize section, select Basic text files (Plain text format) and click the Initialize button. In the Name/Value table, set the PDTFile property to have a value like MyPDT/usribm3250.hodpdt. Also set the printMimeType property to application/octet-stream and the usePDT property to true. For more information see Printing. Users will retrieve their 3270E print output as a binary print file suitable for copying to a particular type of non-Windows printer.
More information on Host On-Demand PDF and PDT files can be found in the Host On-Demand Knowledge Center at http://publib.boulder.ibm.com/infocenter/hodhelp/v11r0/index.jsp?topic=/com.ibm.hod.doc/doc/troubleshoot/pdtcompile.html.
To define print support for 5250 connections, in the editor for your 5250 default connection, click the Printing tab and select the Enable print support check box. Provide a URL for the System i® Access for Web Printer Output window. The default URL is http://hostname/webaccess/iWASpool, where hostname is the name of the 5250 server. Print support for 5250 servers requires that System i Access for Web is installed on the 5250 host containing the print spool. All 5250 print functionality is provided by the System i Access for Web Printer Output servlet on the target 5250 host.
You do not need to perform any additional configuration. When a user of the HATS application issues a command to print files, System i Access for Web converts the host print jobs into PDF format and facilitates the download to the user. The user can click View Print Jobs on the application keypad to display the System i Access for Web Printer Output window. In this window, the user can select the following print options:
Refer to your System i Access for Web documentation for more information about these print options.
To facilitate use of your HATS applications by users, it is recommend that you provide documentation on how to use the print support in HATS. Your documentation--provided either in the application's graphical user interface or in some other easily displayed form (perhaps a link in your template)--should describe:
To use HATS print support, a user should follow these steps:
In the Printer Output window, the user can click options for a print job to either Open or Delete it. If the user clicks open, the print job is displayed as a PDF file in Acrobat Reader, if it is available. If not, the user is prompted to save the file to disk.