IBM Support

Changing the INITPRT (Initialize Printer) Tag to Move Text Toward the Top of the Page

Troubleshooting


Problem

This document provides instructions for modifying a Workstation Customization Table (WSCST) to send offset registration controls to alter the top and left margins when using Host Print Transform (HPT).

Resolving The Problem

Note: This document was previously titled Changing Top and Left Margins.

This document provides instructions for modifying a Workstation Customization Table (WSCST) to send offset registration controls to alter the top and left margins when using Host Print Transform (or HPT).

This is done by retrieving and modifying a Workstation Customization Table (WSCST) and changing the values in the Initialize Printer (INITPRT) tag. For information on modifying a Workstation Customizing Object (WSCST) to increase the no print border, refer to the following document:

N1010142: Changing the NOPRTBDR (No Print Border) Tags to Increase the No Print Border

Note: This document pertains only to printers that use the HP PCL4 printer language or above. If this is the case, the PRTDTASTRM (Printer Data Stream) tag in the WSCST source code will show the DATASTREAM set to HPPCL4, HPPCL4I, HPPCL5, or HPPCL5I.

This document was last updated on 27 November 2012.

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

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, 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 section Changing the INITPRT (Initialize Printer) Tag to Move Text Toward the Top of the Page 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.

Changing the INITPRT (Initialize Printer) Tag to Move Text Toward the Top of the Page

These examples attempt to change the starting point of your printout by adding the Long-Edge (Left) Offset Registration and Short-Edge (Top) Offset Registration PCL controls to the end of the INITPRT (Initialize Printer) tag. The data specified in the INITPRT tag is sent to the printer at the beginning of each operating system spooled file, so changing this tag will affect all spooled files. This can be limited to only certain spooled file by adding these controls to another tag, such as the INDFNTE (Individual Font Entry) tag. This will cause these controls to be sent only when a spooled file is setup to print in that particular font ID.

Default Value of the INITPRT (Initialize Printer) Tag

The default value of the INITPRT (Initialize Printer) tag is:

:INITPRT
     DATA ='1B45'X.


Moving Text Toward the Top When Printing in Portrait

To move text toward the top when printing in portrait, add the Short-Edge (Top) Offset Registration PCL control to the end of the INITPRT (Initialize Printer) tag. The Short-Edge (Top) Offset Registration PCL control is 1B266C2D3336305A, so the INITPRT (Initialize Printer) tag would be changed to:

:INITPRT
     DATA = '1B451B266C2D3336305A'X.


Note: Making this change will not only move text toward the top of the page when printing in portrait, but will also move text to the left when printing in landscape.

Breakdown of the Short-Edge (Top) Offset Registration PCL Control
oThe Short-Edge (Top) Offset Registration PCL control is defined as 1B 26 6C #...# 5A in hexadecimal (or Ec&l#Z in ASCII).
oThe #...# represents the number of Decipoints to offset, or move, the text. A Decipoint is 1/720 of an inch.
oIn the example above, the Short-Edge (Top) Offset Registration PCL control listed above is 1B266C2D3336305A in hexadecimal. The number of Decipoints is preceded by an ASCII minus sign (2D in hexadecimal). The minus sign indicates that the text should be offset, or moved, toward the short-edge. The short-edge is typically the top paper edge when printing in portrait, and the left paper edge when printing in landscape or COR. To move away from the short-edge, specify the Short-Edge (Top) Offset Registration PCL control without the 2D.
oThe number of Decipoints specified above is 360, which equates to 360/720, or 1/2 inch. To move 1/6 inch, instead of 1/2 inch, the number of Decipoints would need to be 120, since 120/720 = 1/6 inch. Therefore, this part of the control would need to be set to 313230 in hexadecimal.

Moving Text Toward the Top When Printing in Landscape and Computer Output Reduction (COR)

To move text toward the top when printing in landscape and Computer Output Reduction (COR), add the Long-Edge (Left) Offset Registration PCL control to the end of the INITPRT (Initialize Printer) tag. The Long-Edge (Left) Offset Registration PCL control is 1B266C33363055, so the INITPRT (Initialize Printer) tag would be changed to:

:INITPRT
     DATA = '1B451B266C33363055'X.


Note: Making this change will not only move text toward the top of the page when printing in landscape or COR, but will also move text to the right when printing in portrait.


Moving Text Away from the Top (Toward the Bottom) When Printing in Landscape and Computer Output Reduction (COR)

To move text away from the top (or toward the bottom) when printing in landscape and Computer Output Reduction (COR), add the Long-Edge (Left) Offset Registration PCL control to the end of the INITPRT (Initialize Printer) tag. The Long-Edge (Left) Offset Registration PCL control is 1B266C2D33363055, with the '2D' (Minus Sign) indicating a shift in the opposite direction, so the INITPRT (Initialize Printer) tag would be changed to:

:INITPRT
     DATA = '1B451B266C2D33363055'X.


Note: Making this change will not only move text toward the bottom of the page when printing in landscape or COR but will also move text to the left when printing in portrait.


Breakdown of the Long-Edge (Left) Offset Registration PCL Control
oThe Long-Edge (Left) Offset Registration PCL control is defined as 1B 26 6C #...# 55 in hexadecimal (or Ec&l#U in ASCII).
oAs with the Short-Edge (Top) Offset Registration PCL control, the #...# represents the number of Decipoints to offset, or move, the text. A Decipoint is 1/720 of an inch.
oIn the example above, the Long-Edge (Left) Offset Registration PCL control listed above is 1B266C33363055 in hexadecimal. The number of Decipoints is NOT preceded by an ASCII minus sign (2D in hexadecimal). When the minus sign is not specified, the text should be offset, or moved, away from the long-edge. The long-edge is typically the left paper edge when printing in portrait, and the bottom paper edge when printing in landscape or COR. To move toward the long-edge, specify the Long-Edge (Left) Offset Registration PCL control with the 2D.
oThe number of Decipoints specified above is 360, which equates to 360/720, or 1/2 inch. To move 1/6 inch, instead of 1/2 inch, the number of Decipoints would need to be 120, since 120/720 = 1/6 inch. Therefore, this part of the control would need to be set to 313230 in hexadecimal.

Moving Text Toward the Top When Printing in Portrait, Landscape and Computer Output Reduction (COR)

To move text toward the top when printing in portrait, landscape and Computer Output Reduction (COR), add both the Short-Edge (Top) Offset Registration and Long-Edge (Left) Offset Registration PCL controls to the end of the INITPRT (Initialize Printer) tag. To change both at the same time, the INITPRT (Initialize Printer) tag would be changed to:

:INITPRT
     DATA = '1B451B266C2D3336305A1B266C33363055'X.


Note: Making this change will not only move text toward the top of the page when printing in landscape or COR, but will also move text to the right when printing in portrait and to the left in landscape.


Moving Text Away from the Top (Toward the Bottom) When Printing in Portrait, Landscape and Computer Output Reduction (COR)

To move text away from the top (toward the bottom) when printing in portrait, landscape and Computer Output Reduction (COR), add both the Short-Edge (Top) Offset Registration and Long-Edge (Left) Offset Registration PCL controls to the end of the INITPRT (Initialize Printer) tag. To change both at the same time, the INITPRT (Initialize Printer) tag would be changed to:

:INITPRT
     DATA = '1B451B266C3336305A1B266C2D33363055'X.


Note: Making this change will not only move text toward the bottom of the page when printing in landscape or COR, but will also move text to the left when printing in portrait and to the right in landscape.


Breakdown of the Long-Edge (Left) Offset Registration and Short-Edge (Top) Offset Registration PCL Controls
oThe Long-Edge (Left) Offset Registration PCL control listed above is 1B266C33363055 in hexadecimal (or Ec&l#U in ASCII).
oThe Short-Edge (Top) Offset Registration PCL control listed above is 1B266C2D3336305A in hexadecimal (or Ec&l#Z in ASCII).
oThe 2D (the ASCII "-" character) in the Short-Edge (Top) Offset Registration PCL control indicates a negative offset. In the case, the 2D printer will attempt to move toward the paper edge.
oEach of these controls has the number of Decipoints (or 1/720 of an inch) set to 333630 in hexadecimal (or 360 in ASCII). 360 Decipoints is 360 720ths of an inch, which is equivalent to 1/2 inch. To move back only 1/6 inch rather than 1/2 inch, the number of Decipoints must be 120 (120/720 = 1/6 inch). Therefore, this part of the control must be set to 313230 in hexadecimal.
Disabling the Perforation Skip

It may also help to disable the perforation skip by adding the Perforation Skip Disable PCL control (1B266C304C in hexadecimal) to the end of the Initialize Printer (INITPRT) tag, as follows:

Short-Edge (Top) Offset Registration PCL Control and Perforation Skip Disable PCL Control:

:INITPRT
     DATA = '1B451B266C2D3336305A1B266C304C'X.


Long-Edge (Left) Offset Registration PCL Control and Perforation Skip Disable PCL Control:

:INITPRT
     DATA = '1B451B266C333630551B266C304C'X.


Short-Edge (Top) Offset Registration PCL Control, Long-Edge (Left) Offset Registration PCL Control, and Perforation Skip Disable PCL Control:

:INITPRT
     DATA = '1B451B266C2D3336305A1B266C333630551B266C304C'X.


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

[{"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":"7.1.0"}]

Historical Number

8705835

Document Information

Modified date:
18 December 2019

UID

nas8N1010120