The OS400
host print transform function
converts the OS400 native spooled-file to
Hewlett Packard® Printer Control Language
(PCL).
You may customise this transformation to PCL by creating
a new work station customisation object (*WSCST) and configuring an
output-queue to use this *WSCST object.
Please note, that all OS400 PTFs must be up to date, particularly those
for printing systems. Many of the problems that our customers have reported
were resolved by the application of the latest PTFs and the use of
MFRTYPMDL(*HP4).
Delete one or both of tags :TOPMARGINI & :TEXTLENL. When you delete
a tag, delete the whole section of code that goes with it. This would include
the lines following down to the next tag that begins with a ':'.
To set 1/2 inch margins, change all the top and bottom no print border
values to 720.
:NOPRTBDR
OPTION=TOP, BOTTOM, LEFT, or RIGHT
ORIENT=PORTRAIT or LANDSCAPE
DATA = 720.
To set 1/4 inch margins, change all the top and bottom no print border
values to 360.
:NOPRTBDR
OPTION=TOP, BOTTOM, LEFT, or RIGHT
ORIENT=PORTRAIT or LANDSCAPE
DATA = 360.
Removing the no print border completely requires a two step process.
Change the :NOPRTBDR DATA values to 0, and add an offset registration
control in the :INITPRT tag. If both top and left margin offset changes
are needed then two controls are required.
The left margin control is '1B266C2D31323055'
and the top margin control is '1B266C2D3132305A'.
These controls do a negative registration of the 1/6" normal
no print border, so printing will start on the edge of the page.
If you want to just change the top margins, you can leave the other
tags as is.
Search for the :PAGSIZE tags. This is the section that sends the controls
for the requested page size.
/* 8.5X11 Letter PAGE SIZE */
:PAGSIZE
PAGWTH=12240
PAGLEN=15840
DATA ='1B266C303241'X.
/* A4 PAGE SIZE */
:PAGSIZE
PAGWTH=11952
PAGLEN=16848
DATA ='1B266C323641'X.
The page size is calculated using 1440ths of an inch. Therefore, for US letter 12240
divided by 1440 is 8.5 inches wide and for European A4, 16848 divided by 1440 is
11.69 inches long. The DATA value is sent in the datastream to represent that page
size. Your source should contain entries for each possible page size.
you can specify the page sizes when creating or changing printer device
files as follows:
CHGPRTF FILE(X) PAGESIZE(11.69 8.27 *UOM) UOM(*INCH) PAGRTT(90) /* A4 */
CHGPRTF FILE(X) PAGESIZE(11 8.5 *UOM) UOM(*INCH) PAGRTT(90) /* LETTER */
When the resulting spooled-files are transformed, the transform function
will match the spooled-file page size to the best fitting page size defined
in your *WSCST object.
The PAGRTT(90) parameter tells the transform
function that the spooled-file contents should be rotated by 90 degrees so that
it can fit on the A4 or Letter page.
You may find it convenient to select a page-size that depends on the printer-drawer
specified by the DRAWER() parameter of the
CRTPRTF/CHGPRTF commands.
Search for the :DRWSLT tags. This is the section that sends the controls
for the requested page size for a selected printer-drawer.
:DWRPAGSIZ.
:DWRPAGSIZE
DRAWER=1
PAGWTH=11952
PAGLEN=16848.
:DWRPAGSIZE
DRAWER=2
PAGWTH=11952
PAGLEN=16848.
:DWRPAGSIZE
DRAWER=3
PAGWTH=11952
PAGLEN=16848.
:EDWRPAGSIZ.
These tags select the
A4 paper-size, for printer-drawers 1, 2 and 3.
Of course it is possible to specify a different page-size for each drawer number.
Host Print Transform will always uses a default translation table.
To change this default to say ASCII code page 850, you must edit or
add the following lines.
:DFTASCCP
ASCIICP=850.
You can use code pages 437 850 1051 or 1252 here. See our PDF file
containing
example code pages.
If a modification of the translation table is needed, add the following
tag rather than the :DFTASCCP tag. To make a change in the translation
table, an entry must be made for each code point. This is a tedious job
but can be done. Add the following after the :EASCCPINFO tag:
:EBCASCTBL.
:EBCASCTBLE
EBCDICCP = 37
ASCIICP = 850
DATA =
/*0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F */
'2020838485A0C68687A4BD2E3C282B7C'X /* 4- */
'268288898AA18C8B8DE121242A293BAA'X /* 5- */
'2D2FB63EB7B5C78F80A5DD2C255F3E3F'X /* 6- */
'9B90D2D3D4D6D7D8DE603A2340273D22'X /* 7- */
'9D616263646566676869AEAFD0ECE7F1'X /* 8- */
'F86A6B6C6D6E6F707172A6A791F792CF'X /* 9- */
'E67E737475767778797AADA8D1EDE8A9'X /* A- */
'5E9CBEFAB8F5F4ACABF35B5DEEF9EF9E'X /* B- */
'7B414243444546474849F0939495A2E4'X /* C- */
'7D4A4B4C4D4E4F505152FB968197A398'X /* D- */
'5CF6535455565758595AFDE299E3E0E5'X /* E- */
'30313233343536373839FCEA9AEBE900'X. /* F- */
:EEBCASCTBL.
Where EBCDICCP indicates the code-page used by the AS400 to generate
the report and ASCIICP which indicates the code-page you want to use
with PCL. You can change the data table to give you the results you need.
The values shown here are obtained
from the Q037BF850 EBCDIC-to-ASCII translation table. Do a WRKTBL
Q037BF850 at the OS/400 command line to view. The table is set up for
EBCDIC with the first character of the code represented on the right column
(/* 4- */) and the second character of the hex code in the top line /* -0-1-2 ....
*/. The first translation in the example is EBCDIC X'40' translated to ASCII
x'20'. Unfortunately, to change one code point requires you to enter every
code point.
You should test your changes by running our OS400 utility command
TSTCHARSET,
sending the spooled-file to PDFing and comparing the
different results until you have the *WSCST object you need.
For some *AFPDS spooled-files, "host print transform" does not always work
as well as it should. In such cases, it may be worth changing your *WSCST object so
that spooled-file contents are sent to PDFing as a bit map. To make this change,
find the
:RASTERMODE and change the source to read as follows:
:RASTERMODE
SCS=NO
AFP=YES.
This change has some disadvantages, data-streams are longer and the PDF reader will
no longer be able to recognize or select text in the PDF.
The RTVWSCST command for an HP LaserJet 4 printer looks similar to the
following:
RTVWSCST DEVTYPE(*TRANSFORM) MFRTYPMDL(*HP4) +
SRCMBR(HP4) SRCFILE(QGPL/QTXTSRC) +
TEXT('Modified WSCST for HP LaserJet 4')
This command will write the *WSCST source into member
HP4 in source-file
QGPL/QTXTSRC
Use either PDM or SEU to edit the source file member.
STRSEU SRCFILE(QGPL/QTXTSRC) SRCMBR(HP4)
This command allows you to edit the *WSCST source in member
HP4 in source-file
QGPL/QTXTSRC
Once the WSCST source member has been edited and saved, you are ready to
create a new Workstation Customization Table (WSCST). On the OS400
command line, extecute the following command:
CRTWSCST WSCST(QGPL/HP4) SRCMBR(*WSCST) TEXT(*SRCMBRTXT) +
SRCFILE(QGPL/QTXTSRC) AUT(*LIBCRTAUT) REPLACE(*YES)
This command creates a *WSCST object named
HP4
in library
QGPL.
To specify that host print transform uses your modified *WSCST object,
execute the command:
CHGOUTQ OUTQ(PDFING) TRANSFORM(*YES) MFRTYPMDL(*WSCST) WSCST(QGPL/HP4)
Here
TRANSFORM(*YES) specifies that
host print transform wil be performed and
MFRTYPMDL(*WSCST) and
WSCST(QGPL/HP4)
specifies that the *WSCST object you have modified is used.
Please note that the transform process removes all the spooled-file attributes,
excepting file-name, user-name and user-defined-text. However, we supply the
CL source for a special
transform exit-program.
If you compile this program, you can set up output-queues referencing this program
and then spooled-file attributes will be sent when the spooled-file is written.
The following command specifies that all the spooled-file attributes will be sent to PDFing
but only
*AFPDS spooled-files will be transformed
CHGOUTQ OUTQ(PDFING) TRANSFORM(*NO) MFRTYPMDL(*WSCST) WSCST(QGPL/HP4) +
USRDTATFM(PDFING/PDFING)
This command specifies that all the spooled-file attributes will be sent to PDFing but
only
*AFPDS spooled-files will be transformed to
PCL.