Troubleshooting
Problem
This document provides instructions for selecting a particular page size by changing how Host Print Transform (HPT) does its page size selection.
Resolving The Problem
This document provides instructions for selecting a particular page size by changing how Host Print Transform (HPT) does its page size selection.
This is done by retrieving and modifying a Workstation Customization Table (WSCST) and changing the Page Size Entry (PAGSIZE) tags to specify a different printer control in the DATA field.
Note: Examples in this document are using the HP PCL5 printer language.
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 27 November 2012.
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 issue(s) 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, HP4000) 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(*HP4000) SRCMBR(HP4000)
SRCFILE(QGPL/QTXTSRC)
Press the Enter key.
Step 2: Edit the source code by using PDM or SEU:
o | To use PDM, on the operating system command line type the following: WRKMBRPDM FILE(QGPL/QTXTSRC) MBR(HP4000) Press the Enter key. Select Option 2 to edit. |
o | To use SEU, on the operating system command line type the following: STRSEU SRCFILE(QGPL/QTXTSRC) SRCMBR(HP4000) Press the Enter key. |
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/HP4000) 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.
o | To 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/HP4000) Press the Enter key. |
o | To 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(HP4000) Press the Enter key. |
o | To 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 HP4000 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.
Information on the Page Size Entry (PAGSIZE) Tag
The following information on the Page Size Entry (PAGSIZE) tag is taken directly from the OS/400 Workstation Customization Programming V4R3, SC41-5605, which is available online at the following Web site:
http://publib.boulder.ibm.com/pubs/pdfs/as400/V4R3PDF/QB3AQ600.PDF
The PAGSIZE (page size entry) tag defines the ASCII control sequence to set one page size. One or more of these tags must follow the PAGSIZXFM (set page size for transform) tag. A group of PAGSIZE tags must be followed by an EPAGSIZXFM (end set page size for transform) tag. The syntax for this tag is:
:PAGSIZE
PAGWTH = page width
PAGLEN = page length
DATA = ASCII control sequence.
PAGWTH
A required parameter. Specifies the page width in 1/1440-inch increments. This value must be an integer. The width is the left-to-right dimension of a piece of paper when it is in its normal orientation.
PAGLEN
A required parameter. Specifies the page length in 1/1440-inch increments. This value must be an integer. The length is the top-to-bottom dimension of a piece of paper when it is in its normal orientation.
DATA
A required parameter. Specifies the ASCII control sequence for selecting a specific page size entry. This must be a hexadecimal value.
Page Size Entry (PAGSIZE) Tag Example
The Page Size Entry (PAGSIZE) tag for Letter sized (8.5 x 11 inch) paper is as follows:
:PAGSIZE
PAGWTH=12240
PAGLEN=15840
DATA ='1B266C303241'X.
The page size is calculated in 1440ths of an inch, so the PAGWTH value of 12240 corresponds to a page width of 8.5 inches and the PAGLEN value of 15840 corresponds to a page length of 11.0 inches. The ASCII control sequence specified in the DATA parameter is '1B266C303241'X (or <Esc> & l 0 2 A in ASCII) which will select letter sized paper on any HP PCL-compatible printer.
Customizing the PAGSIZE Tag
When you are editing the workstation customizing object source using either PDM or SEU, find the Set Page Size (PAGSIZXFM) and Page Size Entry (PAGSIZE) tags. The default PAGSIZE tags for *HP4000 are:
:PAGSIZXFM.
:PAGSIZE
PAGWTH= 8390
PAGLEN=11338
DATA ='1B266C373241'X.
:PAGSIZE
PAGWTH= 8352
PAGLEN=11952
DATA ='1B266C303141'X.
:PAGSIZE
PAGWTH=11952
PAGLEN=16848
DATA ='1B266C323641'X.
:PAGSIZE
PAGWTH=16838
PAGLEN=23811
DATA ='1B266C323741'X.
:PAGSIZE
PAGWTH=10368
PAGLEN=14544
DATA ='1B266C343541'X.
:PAGSIZE
PAGWTH=14570
PAGLEN=20636
DATA ='1B266C343641'X.
:PAGSIZE
PAGWTH=10440
PAGLEN=15120
DATA ='1B266C303141'X.
:PAGSIZE
PAGWTH=12240
PAGLEN=15840
DATA ='1B266C303241'X.
:PAGSIZE
PAGWTH=12240
PAGLEN=20160
DATA ='1B266C303341'X.
:PAGSIZE
PAGWTH=15840
PAGLEN=24480
DATA ='1B266C303641'X.
:EPAGSIZXFM.
To create the WSCST object and implement it, perform Steps 3 and 4 (above).
Note: The example of the RTVWSCST command at the top of this document, and the above example of the Page Size Entry (PAGSIZE) tags, are both using *HP4000 as the base because it contains more PAGSIZE tags than many other MFRTYPMDL settings, such as *HP4.
Details on the PAGSIZE Tags used in the System-Supplied WSCST Objects
The following table provides details on Page Size Entry (PAGSIZE) tags that are found in some of the system-supplied Workstation Customizing Objects (WSCSTs) or MFRTYPMDL settings.
Page Size Entry (PAGSIZE) tag | Page Size | HP PCL Page Size Command (in ASCII) and Brief Description |
:PAGSIZE PAGWTH= 8352 PAGLEN=11952 DATA ='1B266C323541'X. | 148mm x 210mm | <Esc> & l 2 5 A A5 (148mm x 210mm) |
:PAGSIZE PAGWTH=11952 PAGLEN=16848 DATA ='1B266C323641'X. | 210mm x 297mm | <Esc> & l 2 6 A A4 (210mm x 297mm) |
:PAGSIZE PAGWTH=16838 PAGLEN=23811 DATA ='1B266C323741'X. | 297mm x 420mm | <Esc> & l 2 7 A A3 (297mm x 420mm) |
:PAGSIZE PAGWTH=10368 PAGLEN=14544 DATA ='1B266C343541'X. | 176mm x 250mm | <Esc> & l 4 5 A JIS B5 (176mm x 250mm) |
:PAGSIZE PAGWTH=14570 PAGLEN=20636 DATA ='1B266C343641'X. | 250mm x 353mm | <Esc> & l 4 6 A JIS B4 (250mm x 353mm) |
:PAGSIZE PAGWTH=10440 PAGLEN=15120 DATA ='1B266C303141'X. | 7.25 x 10.5 inches | <Esc> & l 0 1 A Executive (7¼ x 10½ in.) |
:PAGSIZE PAGWTH=12240 PAGLEN=15840 DATA ='1B266C303241'X. | 8.5 x 11.0 inches | <Esc> & l 0 2 A Letter (8½ x 11 in.) |
:PAGSIZE PAGWTH=12240 PAGLEN=20160 DATA ='1B266C303341'X. | 8.5 x 14.0 inches | <Esc> & l 0 3 A Legal (8½ x 14 in.) |
:PAGSIZE PAGWTH=15840 PAGLEN=24480 DATA ='1B266C303641'X. | 11.0 x 17.0 inches | <Esc> & l 0 6 A Ledger (11 x 17 in.) |
:PAGSIZE PAGWTH= 8390 PAGLEN=11338 DATA ='1B266C373241'X. | 5.8 x 7.8 inches 148mm x 200mm | <Esc> & l 7 2 A Oufuku-Hagaki Postcard |
Note: Before adding Page Size Entry (PAGSIZE) tags to the WSCST source code, make sure that the printer supports the paper size and the HP PCL Page Size command that you will be sending to the printer.
Printing to a Drawer with Custom Page Size Paper for HP Printers
Some HP LaserJet and compatible printers support the use of custom paper sizes in one or more paper trays. A modified Workstation Customizing Object (WSCST) can access custom page sizes by adding a Page Size Entry (PAGSIZE) tag to specify the HP PCL5 command needed to select the custom page size, and adding a Drawer Page Size (DWRPAGSIZ) tag to assign that custom page size to a specific drawer number.
For example, to access a paper tray with the non-standard paper size of 11.0 x 14.0 inches using drawer 3, the Page Size Entry (PAGSIZE) tag with a page width of 15840 (11.0 x 1440 = 15840) and a page length of 20160 (14.0 x 1440 = 20160) would need to be added, as follows:
:PAGSIZE
PAGWTH=15840
PAGLEN=20160
DATA ='1B266C31303141'X.
The DATA portion of this PAGSIZE tag contains the hexadecimal equivalent of the HP PCL Page Size control '<Esc>&l#A' where # = 101, which indicates a custom page size. For more information on this, refer to the section titled HP PCL Paper Size Command below.
A Drawer Page Size Entry (DWRPAGSIZ) tag with a DRAWER value of 3 (to correspond to the DRAWER parameter in the spooled file attributes) and the same page width and page length also would need to be added, as follows:
:DWRPAGSIZ.
:DWRPAGSIZE
DRAWER = 3
PAGWTH = 15840
PAGLEN = 20160.
:EDWRPAGSIZ.
Note: For this to be completely effective, you must change or override the printer file to set the Source drawer (DRAWER) parameter to 3, and should also make certain that the paper length (page length in inches x the lines per inch) and the paper width (page width x the characters per inch) come out to 11.0 x 14.0 inches.
List of Standard Paper Sizes
Paper Size | Length and Width (in inches) | Length and Width (in millimeters) | Page Length (PAGLEN) (in 1440ths of an inch) | Page Width (PAGWTH) (in 1440ths of an inch) |
A5 | 5.83 x 8.3 inches | 148mm x 210mm | 8352 | 11952 |
A4 | 8.3 x 11.7 inches | 210mm x 297mm | 11952 | 16848 |
A3 | 11.7 x 16.5 inches | 297mm x 420mm | 16838 | 23811 |
B5 | 7.2 x 10.1 inches | 176mm x 250mm | 10368 | 14544 |
B4 | 10.1 x 14.3 inches | 250mm x 353mm | 14570 | 20636 |
LETTER | 8.5 x 11.0 inches | 215mm x 278mm | 12240 | 15840 |
LEGAL | 8.5 x 14.0 inches | 215mm x 355mm | 12240 | 20160 |
EXECUTIVE | 7.25 x 10.5 inches | 184mm x 266mm | 10440 | 15120 |
LEDGER | 11.0 x 17.0 inches | 278mm x 430mm | 15840 | 24480 |
Note: The length and width in inches for the international (A5, A4, A3, B5, and B4) paper sizes and the length and width in millimeters for the US (Letter, Legal, Executive, and Ledger) paper sizes are all approximate.
HP PCL Paper Size Command
The following information on the HP PCL Page Size command was taken from the HP PCL5 Printer Language Technical Reference manual and the HP PCL5 Comparison Guide Addendum that are available from Hewlett Packard at hp.com.
Command String (ASCII / Hex) | Command Name and Description |
Ec & l # A 1B266C..41 | Page Size Command The Page Size command designates the size of the paper, which in turn defines the size of the logical page. PAPER: # = 1 - Executive (7¼ x 10½ in.) 2 - Letter (8½ x 11 in.) 3 - Legal (8½ x 14 in.) 6 - Ledger (11 x 17 in.) 10 - JISExec (Foolscap) 25 - A5 (148mm x 210mm) 26 - A4 (210mm x 297mm) 27 - A3 (297mm x 420mm) 45 - JIS B5 (176mm x 250mm) 46 - JIS B4 (250mm x 353mm) 71 - Hagaki Postcard 72 - Oufuku-Hagaki Postcard ENVELOPES: # = 80 - Monarch (Letter - 3 7/8 x 7½ in.) 81 - Com-10 (Business - 4 1/8 x 9½ in.) 90 - International DL (110mm x 220mm) 91 - International C5 (162mm x 229mm) 100 - International B5 (176mm x 250mm) 101 - Custom Default = 2 (Configurable from Control Panel) |
Note: This information can also be found in the following Rochester Support Center knowledgebase document:
N1014523: List of Common HP PCL5 Commands used by Host Print Transform (HPT)
[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]
Historical Number
8704014
Was this topic helpful?
Document Information
Modified date:
18 December 2019
UID
nas8N1010123