IBM Support

Manipulating Line Spacing

Troubleshooting


Problem

This document provides instructions for changing the line spacing that is used when Host Print Transform (HPT) processes a spooled file. This is most useful to compensate for the line spacing that HPT uses whenever it performs Computer Output Reduction (COR) processing.

Resolving The Problem

This document provides instructions for changing the line spacing that is used when Host Print Transform (HPT) processes a spooled file. This is most useful to compensate for the line spacing that HPT uses whenever it performs Computer Output Reduction (COR) processing, but can be used to change the line spacing for any spooled file that is printed using HPT. This can be done by retrieving and modifying a Workstation Customization Table (WSCST) and changing the Variable Line Spacing (VARLSPC) tag, which will affect the line spacing for *SCS spooled files, or changing the Vertical Absolute Movement (VERAMOV) tag, which will affect the line spacing for *AFPDS spooled files.

For example, spooled files configured with the Lines Per Inch (LPI) parameter set to 6 LPI will typically print at 8 LPI when HPT performs COR processing, but with this document they can be printed at another line spacing, such as 7 LPI. This would still compress the line spacing, but the lines of text would be further apart and there would be less unused space at the bottom of the page.

Caution: Changes to the Variable Line Spacing (VARLSPC) tag affects ALL *SCS spooled files that are sent through *LAN 3812 PJL, SNMP or IPP device descriptions, Remote Output Queues (RMTOUTQs) or PC5250 printer sessions that use the modified Workstation Customizing Object (WSCST), not only those that are setup to use Computer Output Reduction (COR). To have this take effect for only those spooled files that use COR, configure one *LAN 3812 device description, RMTOUTQ or PC5250 printer session that uses the modified WSCST object and configure another one that prints to the same printer without the modified WSCST object (or with a different modified WSCST object that does not change the VARLSPC tag).

Likewise, changes to the Vertical Absolute Movement (VERAMOV) tag affects ALL *AFPDS spooled files that are sent through *LAN 3812 PJL, SNMP or IPP device descriptions, Remote Output Queues (RMTOUTQs) or PC5250 printer sessions that use the modified Workstation Customizing Object (WSCST). To have this take effect for certain spooled files but not others, you must configure one *LAN 3812 device description, RMTOUTQ or PC5250 printer session that uses the modified WSCST object and configure another one that prints to the same printer, but without the modified WSCST object (or with a different modified WSCST object that doesn't change the VERAMOV tag).

Note: Examples in this document are using the HP PCL5 printer language. Therefore, they can be used on WSCST objects retrieved from various system-supplied WSCST objects, including *IBM4039HP, *IBM4312, *IBM4317, *IBM4332, *HP4, *HP5SI, *HP4000, *HP8000, and *LEXOPTRA.

This document was last updated on 28 October 2013.

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 Customizing the Variable Line Spacing (VARLSPC) Tag to Affect the Line Spacing for *SCS Spooled Files or Customizing the Vertical Absolute Movement (VERAMOV) Tag to Affect the Line Spacing for *AFPDS Spooled Files 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.

Customizing the Variable Line Spacing (VARLSPC) Tag to Affect the Line Spacing for *SCS Spooled Files

Once you are editing the workstation customizing object source using PDM or SEU, find the Variable Line Spacing (VARLSPC) tag. The default setting for the VARLSPC tag is:

:VARLSPC
      VAROFFSET=    3
      VARLEN=    3
      VARTYPE=CHRDEC
      CNVNUM=    1
      CNVDEN=   48
      DATA ='1B266C00000043'X.


Hardcoding the Line Spacing

To get the desired line spacing, do the following:

1Append '1B266C' to the DATA string '1B266C00000043',
2Divide 48 by the lines per inch (LPI) desired.
3Convert that number to the ASCII equivalent, in hexadecimal, and append it to the DATA string.
4Lastly, append '43' to the end of the DATA string.

Example to Hardcode the Line Spacing to 5 Lines Per inch (LPI)
1Append '1B266C' to the DATA string '1B266C00000043', which results in:

DATA ='1B266C000000431B266C'X.
2Divide 48 by the 5 LPI, which equals 9.6.
3Convert 9.6 to the ASCII equivalent, in hexadecimal. Each digit can be converted to ASCII by adding X'30' and the decimal point is X'2E', so the ASCII equivalent of 9.6 is X'392E36'. Appending this to the DATA string results in:

DATA ='1B266C000000431B266C392E36'X.
4Lastly, append '43' to the end of the DATA string. The final result is:

DATA ='1B266C000000431B266C392E3643'X.

Other Examples of Hardcoding the Line Spacing

The following are example of the recommended data strings for setting various lines per inch.

5 LPI:DATA ='1B266C000000431B266C392E363043'X.     /* 48 / 5.0 = 9.60 */
5.5 LPI:DATA ='1B266C000000431B266C382E373243'X.     /* 48 / 5.5 = 8.72 */
6 LPI:DATA ='1B266C000000431B266C382E303043'X.     /* 48 / 6.0 = 8.00 */
6.5 LPI:DATA ='1B266C000000431B266C372E333843'X.     /* 48 / 6.5 = 7.38 */
7 LPI:DATA ='1B266C000000431B266C362E383543'X.     /* 48 / 7.0 = 6.85 */
7.5 LPI:DATA ='1B266C000000431B266C362E343043'X.     /* 48 / 7.5 = 6.40 */
8 LPI:DATA ='1B266C000000431B266C362E303043'X.     /* 48 / 8.0 = 6.00 */
8.5 LPI:DATA ='1B266C000000431B266C352E363543'X.     /* 48 / 8.5 = 5.65 */
9 LPI:DATA ='1B266C000000431B266C352E333343'X.     /* 48 / 9.0 = 5.33 */
9.5 LPI:DATA ='1B266C000000431B266C352E303543'X.     /* 48 / 9.5 = 5.05 */
10 LPI:DATA ='1B266C000000431B266C342E383043'X.    /* 48 / 10.0 = 4.80 */
Note: As mentioned above, changes to the Variable Line Spacing (VARLSPC) tag will affect ALL *SCS spooled files that are sent through *LAN 3812 PJL, SNMP or IPP device descriptions, Remote Output Queues (RMTOUTQs) or PC5250 printer sessions that use the modified Workstation Customizing Object (WSCST), not only those that are setup to use Computer Output Reduction (COR). To have this take effect for only those spooled files that use COR, you must configure one *LAN 3812 device description, RMTOUTQ or PC5250 printer session that uses the modified WSCST object and configure another one that prints to the same printer, but without the modified WSCST object (or with a different modified WSCST object that doesn't change the VARLSPC tag).


Commenting Out the TEXTLENL Tag

The Set Text Length in Lines (TEXTLENL) tag is used to send a Text Length PCL control to the printer. If Text Length PCL control follows a Vertical Motion Index (VMI) PCL control, the physical size of the page is recalculated by the printer. This may cause one or more lines of text from the bottom of each page to be printed at the top of the next page. Therefore, it is recommended the Set Text Length in Lines (TEXTLENL) tag be commented out. The default setting for the Set Text Length in Lines (TEXTLENL) tag is:

:TEXTLENL
      VAROFFSET=    3
      VARLEN=    4
      VARTYPE=CHRDEC
      DATA ='1B266C00000000461B26613052'X.

Once commented out, the TEXTLENL tag should look like the following:

/*  :TEXTLENL                              */
/*    VAROFFSET=    3                      */
/*    VARLEN=    4                         */
/*    VARTYPE=CHRDEC                       */
/*    DATA ='1B266C00000000461B26613052'X. */

Disabling the Perforation Skip

In many cases, the printer's perforation skip will need to be disabled to prevent text at the bottom of the page from printing on a page by itself. The default setting for the Initialize Printer (INITPRT) tag is:

:INITPRT
     DATA ='1B45'X.
   :RESETPRT
     DATA ='1B45'X.


To disable the perforation skip on an HP LaserJet or compatible printer, add the Perforation Skip Disable PCL control (X'1B266C304C') to the end of the Initialize Printer (INITPRT) tag, as follows:

:INITPRT
     DATA ='1B451B266C304C'X.
   :RESETPRT
     DATA ='1B45'X.
 


Customizing the Vertical Absolute Movement (VERAMOV) Tag to Affect the Line Spacing for *AFPDS Spooled Files

Customizing the Variable Line Spacing (VARLSPC) tag will affect the line spacing for *SCS spooled files, but not for *AFPDS spooled file. To affect the line spacing for *AFPDS spooled files, the Vertical Absolute Movement (VERAMOV) tag must be changed instead. The default setting for the VERAMOV tag is:

:VERAMOV
VAROFFSET= 3
VARLEN= 5
VARTYPE=CHRDEC
CNVNUM= 1
CNVDEN= 720
DATA ='1B2661000000000056'X.

The CNVNUM field indicates the conversion ratio numerator and the CNVDEN field indicates the conversion ratio denominator, so with the default values above the conversion ratio would be 1/720, which means that vertical movement is done in 1/720 of an inch increments. The DATA field indicates the Host Print Transform (HPT) will send a Vertical Cursor Positioning PCL5e command to the printer that specifies the positioning in Decipoints or 1/720 inch. By changing the CNVDEN field, you can change the conversion ratio between the line spacing used in the spooled file and the number of Decipoints to advance on the printer hardware.

To figure out the CNVDEN value to use to force spooled files to print using a particular Lines Per Inch (LPI), you first need to know the value for the Lines Per Inch (LPI) parameter in the spooled file attributes. The formula for determining the new CNVDEN value is New CNVDEN = Original LPI * Original CNVDEN / New LPI. For example:

Original
LPI

Original
CNVDEN

New
LPI

New
CNVDEN
6
*
720
/
8
=
540
6
*
720
/
9
=
480
8
*
720
/
9
=
640
8
*
720
/
12
=
480

Note that changing the CNVDEN value to 480 will cause 6 LPI spooled files to print at 9 LPI and 8 LPI spooled files to print at 12 LPI. The above formula can be reversed to be New LPI = Original LPI * Original CNVDEN / New CNVDEN, which shows that if you set the CNVDEN value to 540 to force 6 LPI spooled files to print at 8 LPI, then 8 LPI spooled files will be forced to print at 10.67 LPI, since 8 * 720 / 540 = 10.67. If the CNVDEN value is set to 640 to force 8 LPI spooled files to print at 9, then 6 LPI spooled files will print be forced to at 6.75 LPI, since 6 * 720 / 640 = 6.75.

Notes:
oChanges to the Vertical Absolute Movement (VERAMOV) tag will only have an effect when Host Print Transform (HPT) is setup to use mapping mode for *AFPDS spooled files. If using raster mode instead, or rather when the Raster Mode (RASTERMODE) tag has the AFP parameter set to YES, then HPT will compose a bitmap or raster image of each page. Changes to the VERAMOV tag will still cause a different Vertical Cursor Positioning (Decipoints) PCL command to be sent to the printer, but HPT will have composed a bitmap image of the page using the same line spacing as before. No text is sent to the printer when using raster mode, so the Vertical Cursor Positioning (Decipoints) PCL command sent to the printer will not have any affect.
oChanges to the Vertical Absolute Movement (VERAMOV) tag affects ALL *AFPDS spooled files that are sent through *LAN 3812 PJL, SNMP or IPP device descriptions, Remote Output Queues (RMTOUTQs) or PC5250 printer sessions that use the modified Workstation Customizing Object (WSCST). To have this take effect for certain spooled files but not others, you must configure one *LAN 3812 device description, RMTOUTQ or PC5250 printer session that uses the modified WSCST object and configure another one that prints to the same printer, but without the modified WSCST object (or with a different modified WSCST object that doesn't change the VERAMOV tag).
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":"6.1.0"}]

Historical Number

8703311

Document Information

Modified date:
18 December 2019

UID

nas8N1010125