IBM Support

Forcing Spooled Files to Print in Portrait Rather Than COR Using Host Print Transform (HPT)

Troubleshooting


Problem

This document provides information on forcing spooled files to print in portrait rather than using Computer Output Reduction (COR) when printing with Host Print Transform (HPT).

Resolving The Problem

This document provides information on forcing spooled files to print in portrait rather than using Computer Output Reduction (COR) when printing with Host Print Transform (HPT). Additional information is provided on printing spooled files designed for a 13.2 inch print line, which must print in a compressed font, and printing spooled files designed for an 8.0 inch print line, which must print in a non-compressed font (for example, printing at the CPI specified in the spooled file attributes).

Note: The preferred method for printing spooled files in portrait is through the Degree of page rotation (PAGRTT) parameter in the spooled file attributes, which allows control of the orienation on a spooled-by-spooled file basis rather than forcing a particular orientation for all spooled files printed using a modified Workstation Customizing Object (WSCST).

For more information on controlling the orientation through the spooled file attributes, please refer to the following document:

N1018309: Forcing Spooled Files to Print in Portrait by Changing a Printer File and/or Application

If the attributes of a spooled file indicate that it is larger than will fit in portrait on 8.5 x 11.0 inch (letter sized) paper, Host Print Transform (or HPT) will generally print that spooled file in landscape using a compressed font -- assuming the page rotation is either set to *AUTO or *COR. This function of HPT is called Computer Output Reduction (or COR).

This document provides instructions for forcing IBM OS/400 or IBM i5/OS spooled files to print in portrait on 8.5 x 11.0 inch (letter sized) paper whenever HPT would normally perform Computer Output Reduction.

This is done by retrieving and modifying a Workstation Customization Table (WSCST) and changing the values in the Paper Orientation (PRTORIENT) and CPI in COR Mode (CPICOR) tags.

To handle spooled files that are set up with a page rotation of 90 or 270, and therefore do not use the Computer Output Reduction (or COR) feature, please refer to the following document:

N1019680: Printing in Portrait With a Smaller Font Using Host Print Transform (HPT)

Caution: These instructions are provided as is. Any assistance with editing the Workstation Customization Table must be done through a consulting agreement.

This document was last updated on 21 January 2014.




Basic Steps for Creating and Using a Workstation Customization Object

The following are the basic steps for creating and using a Workstation Customization Object (WSCST). Regardless of the particular issues you are attempting to resolve, these steps must always be taken. This information is intended to provide a 'quick start' to creating a WSCST object for users who have at least some familiarity with creating them and with configuring printers.

Note: Additional, in-depth details for creating a WSCST object can be found in the following document:

N1010140: Instructions for Modifying a Workstation Customizing Object (WSCST)

The following are the basic 'quick start' steps.

Step 1: Retrieve the WSCST source code. Type the following command on the operating system command line:

Important Note: Use the Manufacturer type and model (MFRTYPMDL) that is appropriate for your printer. Also, the Source member (in the following example, HP4) is a name that is appropriate to your customizing object. This is what you will be calling your workstation customizing object in Step 3.

RTVWSCST DEVTYPE(*TRANSFORM) MFRTYPMDL(*HP4) SRCMBR(HP4)
         SRCFILE(QGPL/QTXTSRC)

Press the Enter key.

Step 2: Edit the source code by using PDM or SEU:
oTo use PDM, on the operating system command line type the following:

WRKMBRPDM FILE(QGPL/QTXTSRC) MBR(HP4)

Press the Enter key. Select Option 2 to edit.
oTo use SEU, on the operating system command line type the following:

STRSEU SRCFILE(QGPL/QTXTSRC) SRCMBR(HP4)

Press the Enter key.
Make any changes necessary to the WSCST object source code. Refer to the following sections, beginning with Forcing HPT to Print Spooled Files in Portrait Rather Than Landscape, to make your changes, then save and exit. Continue with Step 3.

Step 3: Create the WSCST object using the CRTWSCST command. On the operating system command line type the following:

Important Note: Match the SRCMBR name from Step 1 to the WSCST object name that is created in this step.

CRTWSCST WSCST(QGPL/HP4) SRCFILE(QGPL/QTXTSRC)

Press the Enter key.

Step 4: Add the WSCST to the printer configuration by using the Change Device Print command (CHGDEVPRT), the Change Output Queue command (CHGOUTQ), or by changing the PC5250 printer emulation session configuration.
oTo add the WSCST to a device description, on the operating system command line type the following:

CHGDEVPRT DEVD(device_name) TRANSFORM(*YES) MFRTYPMDL(*WSCSTLETTER)
          WSCST(QGPL/HP4)

Press the Enter key.
oTo add the WSCST to a remote output queue description, on the operating system command line type the following:

CHGOUTQ OUTQ(queue_name) TRANSFORM(*YES) MFRTYPMDL(*WSCSTLETTER)
        WSCST(HP4)

Press the Enter key.
oTo add the WSCST to a PC5250 printer emulation session, do the following:

a In the PC5250 printer session, click on Communication > Configure.
b Click on the Setup button.
c In the Configure PC5250 Printer Emulation window, select the box next to Transform Print Data to ASCII on the iSeries and select the Printer Model value of *WSCST.
d In the same window, specify the name of the WSCST in the Customizing Object parameter and the library where it is found in the Library parameter (for example, Customizing Object HP4 and Library QGPL).
e Click OK three times.
f Click File > Save to save the configuration.

Note: If any changes are made to the WSCST object source code after the CRTWSCST command has been issued, it is necessary to issue the CRTWSCST command again. The printer writer must be ended and restarted for the changes to take effect.

    • - Pre-Built Workstation Customizing Object (WSCST) for Forcing Auto Select for Drawer Selection



      Document N1019007 contains a save file with pre-built Workstation Customizing Objects (WSCSTs) for some of the most requested and most helpful customizations. The attached save file includes a pre-built WSCST object called PCL5PORTRT where the Paper Orientation (PRTORIENT) tags have been set up to force all spooled files to print in portrait and the Set Characters per Inch in COR Mode (CPICOR) tags have been set up to compress 10 CPI fonts to 17.1 CPI, compress 12 CPI fonts to 20 CPI, and compress 15 CPI fonts to 25 CPI.

      For more information, please refer to the following document:

      N1019007: Pre-Built Workstation Customizing Objects (WSCSTs) from IBM iSeries Remote Technical Support Database 'DCF Technotes (IBM i)', View 'Products', Document 'Pre-Built Workstation Customizing Objects (WSCSTs) from IBM System i Remote Technical Support'



    • - Forcing HPT to Print Spooled Files in Portrait Rather Than Landscape

      ] When Host Print Transform (HPT) performs Computer Output Reduction (COR) processing, it sends a control to the printer to set the orientation to landscape and compresses the font. HPT determines what orientation control to send to the printer by looking at the Paper Orientation (PRTORIENT) tags, in particular the PRTORIENT tags for ORIENT=LANDSCAPE and ORIENT=RTT270 (which is reverse landscape). Therefore, operating system spooled files can be forced to print in portrait by changing these particular PRTORIENT tags to send controls that set the orientation to portrait rather than landscape. Edit the Workstation customizing object (WSCST) source member, and find the PRTORIENT tags in the table (you can type PRTORIENT on the SEU command line and press the F16 key). This entry tells HPT what controls to use for the different printer orientations. Computer Output Reduction (COR) is generally used to rotate and shrink output in cases where the pages in the spooled file are too large to fit on the actual page. In this case, HPT will still be shrinking the output, but will no longer be rotating. The PRTORIENT tags are what tell HPT which controls to use for the different printer orientations. The following table shows the original settings for an HP LaserJet 4 and the settings needed to force all output to print in portrait (HPT will no longer be printing in landscape even if specifically requested in the spooled file attributes):

      Default Settings for HP LaserJet 4 Modified Settings for HP LaserJet 4
      :PRTORIENT ORIENT=PORTRAIT DATA ='1B266C304F'X. :PRTORIENT ORIENT=LANDSCAPE DATA ='1B266C334F'X. :PRTORIENT ORIENT=RTT180 DATA ='1B266C324F'X. :PRTORIENT ORIENT=RTT270 DATA ='1B266C314F'X. :PRTORIENT ORIENT=PORTRAIT DATA ='1B266C304F'X. :PRTORIENT ORIENT=LANDSCAPE DATA ='1B266C304F'X. /* Portrait instead of landscape */ :PRTORIENT ORIENT=RTT180 DATA ='1B266C324F'X. :PRTORIENT ORIENT=RTT270 DATA ='1B266C324F'X. /* 180 instead of 270 rotation */
      [


    • - Spooled Files Designed for a 13.2 Inch Print Line

      ] When Host Print Transform (HPT) performs Computer Output Reduction (COR) processing, it not only sends a control to the printer to set the orientation to landscape and compresses the font, but also attempts to print the text in the middle of the page by sending a special control at the beginning of each line to shift it over about 3/10 inch. This results in a 7.7 inch print line, rather than an 8.0 inch print line. Therefore, when the spooled file is designed for an 13.2 inch print line, the font must be compressed to ensure that characters are not truncated when the operating system spooled file is printed. This can be done by modifying the CPI in COR Mode (CPICOR) tags to send a PCL5 font control to the printer that will select a font with the recommended CPI value as shown in the following table:

      CPI Specified in Spooled File Attributes Maximum Characters Per Line (CPL) in Landscape (assuming 13.2 inch Print Line) Recommended CPI Value to Ensure No Truncation in Portrait
      10 132 17.6
      12 158 21.4
      15 198 27.3
      Edit the Workstation customizing object (WSCST) source member, and find the CPI in COR Mode (CPICOR) tags in the table (you can type CPICOR on the SEU command line and press the F16 key). The CPICOR tags are what tell HPT how much to shrink the output through the ASCIIFNT and FNTWTH portions of the CPICOR tag, or what font string to send to the printer through the DATA portion of the CPICOR tag.. The following table shows the original settings for an HP LaserJet 4 and the settings required to print operating system spooled files in portrait rather than landscape without truncating any of the text assuming the maximum characters per line (CPL) values shown above:
      Default Settings for HP LaserJet 4 Recommended Settings for HP LaserJet Printers
      :CPICOR CPI=10 ASCIIFNT= 255 FNTWTH= 84 FNTATR= 1 DATA =''X. :CPICOR CPI=12 ASCIIFNT= 255 FNTWTH= 84 FNTATR= 1 DATA =''X. :CPICOR CPI=15 ASCIIFNT= 255 FNTWTH= 84 FNTATR= 1 DATA =''X. :CPICOR CPI=10 ASCIIFNT= 281 /* ASCII Font ID = 281 */ FNTWTH= 82 /* Font width: 1440 / 17.6 CPI = 82 */ FNTATR= 1 /* Font string: Courier 17.6 CPI */ DATA ='1B2873307031372E3668307330623430393954'X. :CPICOR CPI=12 ASCIIFNT= 281 /* ASCII Font ID = 281 */ FNTWT= 67 /* Font width: 1440 / 21.4 CPI = 67 */ FNTATR= 1 /* Font string: Courier 21.4 CPI */ DATA ='1B2873307032312E3468307330623430393954'X. :CPICOR CPI=15 ASCIIFNT= 281 /* ASCII Font ID = 281 */ FNTWTH= 53 /* Font width: 1440 / 27.3 CPI = 53 */ FNTATR= 1 /* Font string: Courier 27.3 CPI */ DATA ='1B2873307032372E3368307330623430393954'X.
      Note: The above examples send a PCL5 Font String to print in a Courier font. Other printer-resident or built-in fonts can be selected, but it is recommended that you select a fixed-pitch or monospace font to ensure that columns line up. For more information, refer to the following documents: N1019392: Columns of Data do not Line Up when using Typographic Fonts N1010119: List of Default Font IDs Based on Font Range N1010138: Breakdown of HP PCL5 Font Strings [


    • - Spooled Files Designed for an 8.0 Inch Print Line

      ] When Host Print Transform (HPT) performs Computer Output Reduction (COR) processing, it sends a control to the printer to set the orientation to landscape and compresses the font and attempts to print the text in the middle of the page by sending a special control at the beginning of each line to shift it over approximately 3/10 inch. This results in a 7.7-inch print line rather than an 8-inch print line. Therefore, even when the spooled file is designed for an 8-inch print line, the font must be compressed to ensure that characters are not truncated when the operating system spooled file is printed. This can be done by modifying the CPI in COR Mode (CPICOR) tags to send a PCL5 font control to the printer that will select a font with the recommended CPI value as shown in the following table:

      CPI Specified in Spooled File Attributes Maximum Characters per Line (CPL) in Portrait (Assuming 8.0-Inch Print Line) Recommended CPI Value to Ensure No Truncation in Portrait
      10 80 10
      12 96 12
      15 120 15
      Edit the Workstation customizing object (WSCST) source member, and find the CPI in COR Mode (CPICOR) tags in the table (you can type CPICOR on the SEU command line and press the F16 key). The CPICOR tags are what tell HPT how much to shrink the output through the ASCIIFNT and FNTWTH portions of the CPICOR tag, or what font string to send to the printer through the DATA portion of the CPICOR tag.. The following table shows the original settings for an HP LaserJet 4 and the settings needed to print spooled files in portrait rather than landscape, without truncating any of the text, assuming the maximum characters per line (CPL) values shown above:
      Default Settings for HP LaserJet 4 Recommended Settings for HP LaserJet Printers
      :CPICOR CPI=10 ASCIIFNT= 255 FNTWTH= 84 FNTATR= 1 DATA =''X. :CPICOR CPI=12 ASCIIFNT= 255 FNTWTH= 84 FNTATR= 1 DATA =''X. :CPICOR CPI=15 ASCIIFNT= 255 FNTWTH= 84 FNTATR= 1 DATA =''X. :CPICOR CPI=10 ASCIIFNT= 11 /* ASCII Font ID = 11 */ FNTWTH= 144 /* Font width: 1440 / 10 CPI = 144 */ FNTATR= 1 /* Font string: Courier 10.0 CPI */ DATA ='1B2873307031302E3068307330623430393954'X. :CPICOR CPI=12 ASCIIFNT= 85 /* ASCII Font ID = 85 */ FNTWTH= 120 /* Font width: 1440 / 12 CPI = 120 */ FNTATR= 1 /* Font string: Courier 12.0 CPI */ DATA ='1B2873307031322E3068307330623430393954'X. :CPICOR CPI=15 ASCIIFNT= 222 /* ASCII Font ID = 222 */ FNTWTH= 96 /* Font width: 1440 / 15 CPI = 96 */ FNTATR= 1 /* Font string: Courier 15.0 CPI */ DATA ='1B2873307031352E3068307330623430393954'X.
      If you want to print in a slightly smaller font to allow for a few extra characters before truncation occurs, try the following settings instead:
      Default Settings for HP LaserJet 4 Recommended Settings for HP LaserJet Printers
      :CPICOR CPI=10 ASCIIFNT= 255 FNTWTH= 84 FNTATR= 1 DATA =''X. :CPICOR CPI=12 ASCIIFNT= 255 FNTWTH= 84 FNTATR= 1 DATA =''X. :CPICOR CPI=15 ASCIIFNT= 255 FNTWTH= 84 FNTATR= 1 DATA =''X. :CPICOR CPI=10 ASCIIFNT= 11 /* ASCII Font ID = 11 */ FNTWTH= 144 /* Font width: 1440 / 10 CPI = 144 */ FNTATR= 1 /* Font string: Courier 10.4 CPI */ DATA ='1B2873307031302E3468307330623430393954'X. :CPICOR CPI=12 ASCIIFNT= 85 /* ASCII Font ID = 85 */ FNTWTH= 120 /* Font width: 1440 / 12 CPI = 120 */ FNTATR= 1 /* Font string: Courier 12.5 CPI */ DATA ='1B2873307031322E3568307330623430393954'X. :CPICOR CPI=15 ASCIIFNT= 222 /* ASCII Font ID = 222 */ FNTWTH= 96 /* Font width: 1440 / 15 CPI = 96 */ FNTATR= 1 /* Font string: Courier 15.6 CPI */ DATA ='1B2873307031352E3668307330623430393954'X.
      Note: The above examples send a PCL5 Font String to print in a Courier font. Other printer-resident or built-in fonts can be selected, but it is recommended that you select a fixed-pitch or monospace font to ensure that columns line up. For more information, refer to the following documents: N1019392: Columns of Data do not Line Up when using Typographic Fonts N1010119: List of Default Font IDs Based on Font Range N1010138: Breakdown of HP PCL5 Font Strings [





    To create the WSCST object and implement it, perform Steps 3 and 4 (above).

    [{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"Print","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"Version Independent;7.1.0;7.1;6.1.1;6.1.0;6.1;5.4.5;5.4.0;5.3.5;5.3.0;5.2.0;5.1.0;4.5.0;4.4.0;4.3.0;4.2.0;4.1.0;3.2.0","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Product":{"code":"SSC52E","label":"IBM i 7.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}},{"Product":{"code":"SSC3X7","label":"IBM i 6.1"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":" ","Platform":[{"code":"","label":null}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

    Historical Number

    8234436

    Document Information

    Modified date:
    18 December 2019

    UID

    nas8N1010170