IN343 - Extended PF Printing

Total Page:16

File Type:pdf, Size:1020Kb

IN343 - Extended PF Printing

Extended PF Printing

Extended PF Printing

1. Introduction This document describes the Extended PF Printing option available for 32-bit applications using the GX User Interface. This advanced printing option uses the Thin Client Print Interface (“TCPI”) extension to GX. This new option allows high quality reports to be produced with minimal modification of existing application code. The first release of this facility is included in GSM SP-17.

The enhancements greatly extend the printing functionality available to the application designer. Reports can now be printed on a variety of “backdrops”, such as watermarks and/or borders, without changing application code. The same backdrop capability allows form-print applications to be produced quickly, while removing the need for pre-printed stationery.

Other new printing capabilities include full control over fonts and font sizes, styles and colours. Three new styles of underlining and over-scoring are now supported, in addition to a further 3 new box styles.

Reports can be directed to a viewer, thus allowing the user to preview output before printing. From there, the user can print all or part of the report, or discard it altogether. When mistakes are made, this lets the user suppress the report immediately.

The Thin Client Print Interface (TCPI) protocol transfers report data to the client using absolutely minimal bandwidth. Using FLTP (Field Level Transport Protocol) techniques, the interface typically transmits as little as 2 or 3KB per printed page. This provides unparalleled printer support for remote sites, which can now be produced without degrading other on-line users. In common with FLTP, the technology is suitable for use with wireless and other low bandwidth Internet connections such as dial-up links.

As a bonus, all printing overhead, such as page rendering and printer management, is exported to the GX client computer by this printing mechanism. This will result in a significant boost to server performance in many GSM configurations.

PDF output generally produces scalable reports, which are highly portable in terms of printer compatibility and ‘e-mail ability’. In addition, PDF output allows the PDF report viewer to be invoked as an enhancement or alternative to direct printing.

Technical Note IN343 Issue 33 Page 1 of 41 Extended PF Printing

Other enhancements include the removal of many prior restrictions. Reports page sizes can now be 1023 lines by 1023 columns. Individual fields may now be up to 255 characters long. Restrictions previously applying to Local Fields have been removed. Overflow conditions, arising when a display picture is too small to accommodate a field, no longer cause program termination.

1.1 Compatibility The Extended PF printing option released in GSM SP-17 is forward compatible with all prior releases. Traditional PF printing continues to be supported in GSM SP-17, and later. Note that the $SDL32 and $COMPILE compilers produce normal PF print programs by default. In order to enable Extended PF Printing you must use the $SDL32/$COMPILE compiler option “XP” when compiling Extended PF compliant programs. Thus, it is not possible to mix traditional PF printing and extended PF printing in the same frame but the two types of PF printing may be freely mixed, within separate frames, in an application.

As an alternative to the “XP” option $COMPILE (SP-23 and later) and $SDL32 (SP-24 and later) recognise the EXTENDED-PRINTING directive after the PROGRAM/FRAME statement to indicate Extended PF Printing. This in-source directive can replace the use of the XP run- time compiler option. Using the EXTENDED-PRINTING statement allows a mixture of “Extended PF” frames and “traditional PF” frames within a single source. For example:

FRAME PRINTPF * * Traditional PF Printing * DATA DIVISION PF…. PROCEDURE DIVISION . . PRINT PF . . ENDFRAME

FRAME PRINTXF EXTENDED-PRINTING * * Extended PF Printing *

Technical Note IN343 Issue 33 Page 2 of 41 Extended PF Printing

DATA DIVISION PF…. PROCEDURE DIVISION . . PRINT PF . . ENDFRAME ENDSOURCE Note that it is NOT possible to mix Extended PF’s and Traditional PF’s within a single frame.

1.1.1 Printing Sub-Routines The following sub-routines are invalid for use with Extended PF printing:

Sub-Routine Description Comments B$PRO Printer Open Replaced by B$XPO and is documented below B$PRC Printer Close Replaced by B$XPC and is document below B$MNT Obsolete and is not supported for Extended PF printing B$PPF Obsolete and is not supported for Extended PF printing B$PRL Obsolete and is not supported for Extended PF printing

Calls on any of the above sub-routines will lead to unpredictable results if made to print Extended PF reports. Care must be taken to ensure all these calls are removed from Extended PF report programs.

1.1.2 Printing System Variables The pre-Extended PF Printing System Variables have been carried forward so far as possible:

System Description Comments Variable $PGNO Page Count Continues to be supported in this release. Note that the application program must not alter this System Variable.

Technical Note IN343 Issue 33 Page 3 of 41 Extended PF Printing

$PGNX Extended Page Count Supported in GSM SP-18, and later. Note that the application program must not alter this System Variable. $PRUN Printer Unit Present but ignored. $LINO Current Line Number Obsolete as position is now determined by pixel addressing. No replacement has been provided, as it is not clear how an application program could use it. $RSPG Restart Page Number Not supported by Extended PF printing. $PHLT Printer Halt Switch Not currently supported. Setting this flag to -1 should cause the application to exit with a Stop Run if the user cancels printing. This feature is invoked when the operator clicks Cancel to the Printer Selection Window. Setting the switch to 1 (which previously suppressed the Print Interrupt request prompt) has no effect, as such a window is no longer displayed. $PXOF New for GSM SP-17 This System Variable allows you to specify an additional vertical offset in columns by which the current report is to be right-shifted. This allows you to centre an existing report within a backdrop without needing to recode all of the column positions. The variable is set to zero when the report completes. It should be set immediately before the printer is opened. $PYOF New for GSM SP-26 This System Variable allows you to specify an additional vertical offset in lines by which the current report is to be shifted. This allows you to centre an existing report within a backdrop without needing to recode all of the column positions. The variable is set to zero when the report completes. It should be set immediately before the printer is opened.

1.1.3 PF Fields Not Blanked The implementation of "traditional" PF Printing involved the construction of a physical Print-Line in memory. All local PF variables (i.e. variables that start with the same 2 character field name as the PF and are not elsewhere declared) are simply re-definitions of

Technical Note IN343 Issue 33 Page 4 of 41 Extended PF Printing that print line structure. The Print-Line is cleared after every printing operation causing local PF variables to be set to SPACES.

With Extended PF Printing, no physical Print-Line structure exists in the server, as the print- line is physically being assembled by GX on the local GX PC, which is not, of course, directly addressable from the Global program. This approach has the advantage that local PF variables can now be treated like any other print variable, removing a number of limitations such as the ability to define local computation fields and use of the variety of FMT options. This does mean however, that when converting code that uses a Traditional PF to an Extended PF, programs must be checked to determine if any local PF fields are assumed to be set to spaces following the Print operation(s). If so, such fields must be cleared explicitly by the application.

1.2 Omitted Features The Extended PF Printing option released with GSM SP-17 does not include support for the MOUNT statement.

No default Style Sheets have been provided for Horizontal (landscape) Page Layouts.

1.3 Installation Backdrop images files are downloaded automatically to the GX client, where they are cached. All images must be available on the Global Application Server (i.e. the computer that is running GLOBAL.EXE) in the Windows folder specified by the following registry setting:

..\Client\Customisations\PFPrintImagesFolder

If this registry setting is not defined the "PFPrintImages" folder, relative to the GSM folder is used. For example, if GSM is installed into C:\GSM the various image files must be available in folder C:\GSM\PFPrintImages.

1.3.1 Additional Software Required In order to convert a textual print file to PDF format, GX requires the use of one of the following DLLs:

PDF_In_The_Box.DLL All_In_The_Box.DLL

These DLL’s can be purchased and downloaded from the following web-site:

Technical Note IN343 Issue 33 Page 5 of 41 Extended PF Printing

http://www.synactis.com/

Please ensure that you comply with the licensing requirements for this 3rd party software.

Once installed, the PDF_In_The_Box.DLL or All_In_The_Box.DLL file should be copied into the current GX folder. This can be performed automatically by the GX file update procedure (see Technical Note IN271 for further details).

By default, the internal PDF viewer included within the All_In_The_Box.DLL is used. This option can be disabled using by setting “UseAllInTheBoxInternalViewer” to “Off” in the [pfprint] section of the GX.INI file.

1.4 Extended PF Print Program Structure For GSM SP-23, and lower, the maximum number of unique PF blocks included in a single print file is 127. For GSM SP-24, and higher, the maximum number of unique PF blocks included in a single print file is 255.

All printing statements for a single Extended PF must be in the same program module. The PF cannot be opened in one module, lines printed in another, and the PF closed in yet another. If the application is structured such that the routines performing the printing are separate from the data access statements for the record-based data to be printed, then ALL the various PF routines must be included in a separate DLM. For example

FRAME XPRINT ACCESS RC . . PROCEDURE DIVISION . . CALL XPOP * Call print open routine . . FETCH NEXT RC ON NO EXCEPTION CALL XPPR * print a record END . . CALL XPCLS * close routine EXIT

Technical Note IN343 Issue 33 Page 6 of 41 Extended PF Printing

ENDFRAME ENDSOURCE

FRAME XPRTNS LOAD-MODULE DATA DIVISION . . PF P1…….. . . PROCEDURE DIVISION ENTRY XPOP CALL B$XPC EXIT ENTRY XPPR . PRINT P1 . . EXIT ENTRY XPCLS CALL B$XPC EXIT ENDFRAME ENDSOURCE

Important Note: Under no circumstances should the printing routine be included in a separate Print Frame that is executed using an EXEC statement. This is because the EXEC statement will reload the Print Frame thus resetting any variable data used by the Extended PF Printing Manager that is held in the control block(s) generated by the PF statement.

To summarize: ALL the code statements that explicitly or implicitly use an Extended PF must be in the same frame, or in one, or more, DLM's, linked to the frame that contains the PF statement. Code statements that explicitly or implicitly use an Extended PF must NOT be in a different frame from each other, or in a different frame from the one that contains the PF statement.

2. Extended PF Language Extensions

2.1 The PF Attribute Clause

Technical Note IN343 Issue 33 Page 7 of 41 Extended PF Printing

This clause allows a default print attribute to be assigned to the PF within the PF construct. It is coded after the option START statement as follows:

ATTRIBUTE n

Where n is a numeric literal in the range 0 to 31. The statement must be coded as the first statement after the PF declaration, and associates the print attribute number with the PF. If no Attribute statement is coded, then the attribute defaults to Attribute zero (Normal Data). Note that the clause sets a default attribute for the PF, which you can subsequently override using the PRINT statement new ATTRIBUTE clause (see section 2.3).

2.1.1 Programming Note You will typically assign different Attribute Numbers to the Report Header and Labels, and the data printed in the report. You could also assign a different attribute to (say) the totals line, to print it in a larger and/or emboldened font.

You can override this attribute at run-time using the PRINT statement. This is useful when highlighting certain PF print lines, such as errors. The same mechanism can also be used to print “Piano Lines”, in which subsequent lines use different colour combinations. To do this you simply print each alternate PF specifying a different attribute number.

Note that the attribute number coded must be represented by a corresponding entry in the Style-Block. If no attribute information is present in the Style-Block, then the requested attribute will be ignored, and it will be printed using the “Normal Data” attribute instead.

Important Note: The default attribute also indicates the cell size used for ALL items in the PF. If an item in the PF has been assigned another attribute (see PF line detail options below) that has a different cell size associated with, the cell size of the default attribute will be used and not the cell size of the line detail attribute. It is therefore important that the cell size for the default attribute of the PF is large enough to accommodate all the line detail attributes.

2.1.2 Enhancements for GSM SP-22 For GSM SP-22, and later, it is possible to change the attribute for a given field or text item. It is also possible to add to, or change, an attribute in the current Style-Block.

2.2. PF Detail Line Options The following Detail Line options have been added to the PF construct:

UL1 Standard Underline

Technical Note IN343 Issue 33 Page 8 of 41 Extended PF Printing

UL2 Underscore UL3 Double Underscore OS1 Standard Over-score OS2 Bold Over-score OS3 Double Over-score BX1 Small Box BX2 Standard Box BX3 Bold Box RJF Right Justified LJF Left Justified LAB Label (only supported in GSM SP-19, and later) Ann Attribute number where nn is “00” to “31” (see section 2.2.2)

In addition, ADD and FMT are available as in standard PF’s.

Options UL1 to UL3 are underlining options. UL1 causes the field to be printed with a standard underlining. The underline extends the complete width of the field, and is printed within the space used by the font. Options UL2 and UL3 are printed on the next print line.

Options OS1 to OS3 specify over-scoring. Option OS1 causes the field to be printed with a standard over-score. The over-score extends the complete width of the field, and is printed within the space used by the font (meaning it uses no additional vertical space). Over-score options 2 and 3 are printed on the preceding print-line. When using these you must reserve a line in the PF definition for the over-score to be printed. For this reason, OS2 and 3 are never valid on a detail line coded on Line 1.

Options BX1 to BX3 specify Box styles to be drawn around the field. BX1 indicates a single pixel box drawn around the field. It is drawn immediately around the field so that there is no gap. Option 2 again specifies a 1-pixel box drawn, this time drawn with a 1-pixel gap around the circumference of the field. Option 3 similarly codes for a bold box with the same gap.

Options RJF and LJF specify right and left justification respectively. By default, all numeric fields are automatically right justified, and all other field types are left justified. You may alter this default behaviour using these options.

Option LAB is available to allow you to indicate that the field should be considered as a label. This option was introduced in GSM SP-19 to aid the GX translation of PF’s.

2.2.1 Programming Note

Technical Note IN343 Issue 33 Page 9 of 41 Extended PF Printing

All of the options shown above are valid for both literal and variable fields within the PF. When printing with proportional fonts, justification becomes essential. To ensure that labels line up correctly over a column of numbers, you should specify right-justification in the PF definition. Note that irrespective of justification, the column position coded always specifies the left-most byte position of the field.

2.2.2 Additional Notes for the Attribute Number option The Ann Attribute Number Detail Line option is only supported by GSM SP-22, and later. Furthermore, this option is only supported in the GSM SP-22 (and later) $COMPILE compiler and the GSM SP-24 (and later) $SDL32. The option is NOT supported in any version of $SDE32.

Option Ann allows the field to be printed using the specified font attribute. Care should be taken if the attribute has a different font size. The positioning of a field will depend on the cell size defined for the attribute assigned to its PF block. Care should be taken when positioning fields if any field has an attribute with a larger cell size.

2.3 The PRINT statement ATTRIBUTE Clause The Print statement may now be coded with an Attribute Clause as follows:

PRINT PF [ ATTRIBUTE attr ] [NEWPAGE]

The statement prints the PF optionally assigning a new Print Attribute attr. The selected attribute overrides the PFs default attribute for the current print operation only.

As for traditional PFs, if the NEWPAGE option has been coded, a page advance will take place.

For GSM SP-19, and later, an additional Backdrop clause is available:

PRINT PF [ATTRIBUTE Attr] [ NEWPAGE [BACKDROP bk]]

This allows you to change the backdrop on a new page. Important Note: The BACKDROP clause cannot be coded without the NEWPAGE clause.

The bk backdrop control block is defined as follows:

01 BK 02 BKVERS PIC 9(2) COMP * Block version number must be 1 VALUE 1 02 BKNAM PIC X (64) * Image path name

Technical Note IN343 Issue 33 Page 10 of 41 Extended PF Printing

02 BKO * Backdrop origin (Top-Left) 03 BKBORX PIC 9(4) C * - X axis; vert in 1/10th mm 03 BKBORY PIC 9(4) C * - Y axis; horiz in 1/10th mm 02 BKBSZE * Backdrop dimensions 03 BKBSZX PIC 9(4) C * - X axis; width in 1/10th mm 03 BKBSZY PIC 9(4) C * - Y axis; depth in 1/10th mm 02 BKBIMG PIC X * Image alignment property * “0” – Print as is (no stretch) * “1” – Stretch in proportion * “2” - Stretch to fit 02 BKVALG PIC X * Vertical alignment * “T” – Place at top * “C” – Centre * “R” – Place at right 02 BKHALG PIC X * Horizontal alignment * “L” – Place at top * “C” – Centre * “R” - Place at right

The BK control block is available as copy-book $B in the S.SYS32 copy-library.

2.4 The MOUNT statement The MOUNT statement is NOT supported in the Extended PF Printing option.

2.5 The PF NOTRIM Clause For GSM SP-24, and later, the “NOTRIM” option on the PF statement is supported.

By default, to optimise the amount of data transmitted to GX, trailing spaces are trimmed from all print fields that are sent to GX. The “NOTRIM” option prevents this default behaviour so that trailing SPACE’s are not removed from fields with the PF. With the “NOTRIM option enabled, the underscore, over-score and box field attributes will underline, over-score and surround the entire field including any trailing spaces. This option is coded after the START or ATTRIBUTES statements within the PF as follows:

NOTRIM

2.6 Meta-Characters for Horizontal Lines For GX.EXE V4.4i, and later, the following meta-characters are recognised:

#80 Single horizontal line character #81 Double horizontal line character

Note that GX propagates the meta-character along a sub-string of SPACES up to the full length of the string. For example it is not necessary to add the tedious VALUE clause to print a single horizontal line equivalent to 10 characters:

Technical Note IN343 Issue 33 Page 11 of 41 Extended PF Printing

77 X-SLINE PIC X(10) VALUE#80808080808080808080

The following will suffice:

77 X-SLINE PIC X(10) VALUE#80 * the compiler will pad the string with trailing SPACES * and GX will propagate the #80 along the SPACES

3. Extended PF Sub-Routine Calls The sub-routines described in this section allow you to open and close the printer; and (for GSM SP-22, and later) to add or change attributes within the current Style-Block.

Note that it is essential that you explicitly close the printer. It is possible that a future version of the Extended PF Printing option will ensure the printer is automatically closed on termination.

3.1 The OPEN Printer Call – B$XPO The original version of the B$XPO sub-routine released with GSM SP-17, and included in GSM SP-18, was modified for GSM SP-19, and later.

3.1.1 The OPEN Printer Call – B$XPO (GSM SP-17 and GSM SP-18) This call allows you to open the printer, optionally specifying a System Style-Block and optional font. It is coded:

CALL B$XPO [USING Title [ Print-Opt [ style-block-id [ font ]]]]

Where Title is a PIC X(64) variable containing the reports title, Print-opt is a PIC X(2) string literal containing print options, style-block-id is a PIC X(8) string literal or variable containing the name identifying a standard system Style-Block; and font is a PIC X(64) variable containing the name of the font to be used for the report.

Important Note: This interface was changed for GSM SP-19 (see section 3.1.2).

It is not necessary to explicitly open the printer. If you do not do so, the printer will be opened automatically when the first PRINT statement is executed. In this event, the report name will default to “Speedbase TCPI Report”, opened in Review Mode, with Preservation, using System Style-Sheet “P132V100” with the Style-Sheets default font.

Technical Note IN343 Issue 33 Page 12 of 41 Extended PF Printing

The optional report title is used to identify the report. When spooled this name is used as the file-name, and you must take care that the supplied name conforms to Windows file- naming conventions. It is essential that this parameter is passed as a PIC X(64) variable.

The optional Print-opt indicates whether the report is to be reviewed or printed, and whether it is to be preserved. The first character can be “R” to review the report, or “P” to print it. The second character can be set to P to preserve the report, or D to delete it. Passing the string “RD” therefore indicates that the report is to be reviewed, and then deleted, while “PP” indicates the report is to be printed and preserved.

If you pass a Style-Block-id in the call it must match one of the standard Style-Blocks which are described in section 4. If the Style-Block name you pass is incorrect, it will again default to “P132V100”, without resulting in an error.

You may additionally supply a font name. The font name will over-ride the standard font associated with the Style-Block. You must ensure that the chosen font is compatible with the Style-Block, i.e. that the characters of that font will fit within the space allocated by the chosen style, or does not turn out to be un-readably small. In general, PDF output switches fonts more successfully than Microsoft output. It is essential that the Font name is passed as a 64-character variable. If you do not do this, or if the font name is invalid or not available on the GX Client, then the font will again revert to standard fixed pitch.

Important Note: The selected font must be a TrueType font or the print will fail unexpectedly. For example, the raster (bitmapped) “Courier” font will fail to produce an output file whereas the TrueType “Courier New” font should not present any problems.

The open call can return four exception conditions:

Exception Code Meaning 1 GX is unable to fulfil the print request, because the backdrop file specified in the Style-Block could not be located. 2 The user has cancelled the print-run. 3 PDF printing is not available on the GX client. The PDF printing DLL must first be installed on the client. 4 GX does not support preview mode on the client machine. This will occur if you attempt to preview Microsoft Output.

Note that these exceptions can only be trapped by the B$XPO call. If do not explicitly open the printer using this sub-routine, any of these conditions will cause your program to be terminated.

Technical Note IN343 Issue 33 Page 13 of 41 Extended PF Printing

3.1.2 The OPEN Printer Call – B$XPO (GSM SP-19 and later) This call allows you to open the printer, optionally specifying a User-Defined Style-Block and optional font. It is coded:

CALL B$XPO [USING xp [ pa]] where xp is a control block of the following format:

01 XP 02 XPVERS PIC 9(4) COMP * Control block version VALUE 1 * Must be 1, 2, 3 or 4 * * A value of 2 is only recognised by * * GSM SP-21, or higher; a value of 3 is * * only recognised by GSM SP-26, or higher; * * a value of 4 is only recognised by GSM * * SP-27, or higher 02 XPTITP PIC PTR * Pointer to Title text * (terminated by LOW-VALUE byte) 02 XPOPT PIC X(2) * Options flag. Set to any of: * “RD”, “PD”, “ND”, “RP”, “PP” * or “NP”. For GSM SP-26, and later, * other options are possible. * (not all these combinations are useful) 02 XPSTYLE PIC X(8) * In-built style name 02 XPFNTP PIC PTR * Pointer to font name (max 64 bytes) * (terminated by LOW-VALUE byte) * * The following fields are only recognised if XPVERS > 1. * 02 XPFPNT PIC 9(2) COMP * Font-point size (0 = Use default) 02 XPACLX PIC 9(4,2) COMP * Cell width 1/10th mm (0=Use default) 02 XPACLY PIC 9(4,2) COMP * Cell depth 1/10th mm (0=Use default) * * The following field is only recognised if XPVERS > 2. * 02 XPFLAG PIC 9(2) COMP * Extra flag. Reserved for future use. VALUE 0 * MUST BE ZERO * * #01 = Align CR/DR at end of numeric fields * * The following field is only recognised if XPVERS > 3. * 02 XPSPIN PIC 9(4) COMP * Printer Index number (1 – 9)

The XP control block is available as copy-book $X in the S.SYS32 copy-library.

If the font-point size is specified in the XP-block, that value will override the font-point size settings for ALL the attributes in the PA-block. If the cell width is specified in the XP-block, that value will override the cell width settings for ALL the attributes in the PA-block. If the cell depth is specified in the XP-block, that value will override the cell depth settings for

Technical Note IN343 Issue 33 Page 14 of 41 Extended PF Printing

ALL the attributes in the PA-block. However, it will not override any attributes added or amended using a later B$XPAT call.

It is not necessary to explicitly open the printer. If you do not do so, the printer will be opened automatically when the first PRINT statement is executed. In this event, the report name will default to “Speedbase TCPI Report”, opened in Review Mode, with Preservation, using System Style-Sheet “P132V100” with the Style-Sheets default font.

The XPTITP pointer points to the optional report title string (terminated by #00), which is used to identify the report. When spooled this name is used as the file-name, and you must take care that the supplied name conforms to Windows file-naming conventions. If you do not want to set a title you must set the XPTITP pointer to HIGH-VALUES.

The optional XPOPT field indicates whether the report is to be reviewed or printed, and whether it is to be preserved. The first character can be “R” to review the report, “P” to print it or “N” to do neither. Note that the “N” option is only supported by the combination of GSM SP-22 (or later) and GX V4.1m (or later). The second character can be set to P to preserve the report, or D to delete it. Passing the string “RD” therefore indicates that the report is to be reviewed, and then deleted, while “PP” indicates the report is to be printed and preserved. A string of “NP” indicates that the report will neither be reviewed nor printed but the report file will be preserved.

For GSM SP-26, and later, the 1st character of XPOPT can be “1”, “2” or “3” to specify Printer Tray-1, Printer Tray-2 or Printer Tray-3, respectively. Printer Tray selection is only available with GX V4.4m, or later (see Appendix-B for more details).

The XPFLAG field is reserved for future use and must be set to 0.

For GSM SP-27, and later, the XPSPIN field can be used in conjunction with the PrinterName1 to PrinterName9 GX.INI file settings to change the printer from the Windows default. This feature requires GX V4.4u, or later (see Appendix-B for more details).

If you pass a Style-Block-id in the call it must match one of the standard Style-Blocks that are described in section 4. If the Style-Block name you pass is incorrect, it will again default to “P132V100”, without resulting in an error.

You may additionally supply a font name by pointing XPFNTP at the font name string (terminated by #00) in your program. The font name will over-ride the standard font associated with the Style-Block. You must ensure that the chosen font is compatible with

Technical Note IN343 Issue 33 Page 15 of 41 Extended PF Printing

the Style-Block, i.e. that the characters of that font will fit within the space allocated by the chosen style, or does not turn out to be un-readably small. It is essential that the font name does not exceed 64 characters. If you do not do this, or if the font name is invalid or not available on the GX Client, then the font will again revert to standard fixed pitch. If you do not want to set a font then you must move HIGH-VALUES into the XPFNTP pointer.

Important Note: The selected font must be a TrueType font or the print will fail unexpectedly. For example, the raster (bitmapped) “Courier” font will fail to produce an output file whereas the TrueType “Courier New” font should not present any problems.

If you do not want to use any of the standard Style-Blocks described in section 4, you may define your own Style-Block by supplying the optional pa parameter. User defined Style- Blocks are described in section 5.

The open call can return four exception conditions:

Exception Code Meaning 1 GX is unable to fulfil the print request, because the backdrop file specified in the Style-Block could not be located. 2 The user has cancelled the print-run. 3 PDF printing is not available on the GX client. The PDF printing DLL must first be installed on the client. 4 GX does not support preview mode on the client machine. This will occur if you attempt to preview Microsoft Output.

Note that these exceptions can only be trapped by the B$XPO call. If do not explicitly open the printer using this sub-routine, any of these conditions will cause your program to be terminated.

3.2 The Close Printer Call B$XPC This call causes the printer to be closed. It is coded:

CALL B$XPC

The call causes the last page (if any) to be released, after which the printer channel is closed.

3.3 The Change/Add Attribute Call B$XPAT

Technical Note IN343 Issue 33 Page 16 of 41 Extended PF Printing

This routine is only available for GSM SP-22 or later. It allows a specified font Attribute in the current Style-Block being used for printing to be modified or added. The routine will be called as follows:

CALL B$XPAT USING number at where number is a PIC 9(4) COMP variable or literal indicating the attribute number (0 to 31) and the at control block is defined as follows:

01 AT 02 ATVERS PIC 9(4) COMP * Block version number * Must be 1 02 ATITLC PIC 9(2) COMP * 1 Italics 02 ATTRAS PIC 9(2) COMP * 1 Transparent 02 ATFONT PIC X(64) * Font name 02 ATWGHT PIC 9(4) C * Font weight. The only values supported * * are: 0 = Normal; 900 = Bold 02 ATPTSZ PIC 9(2) COMP * Point size 02 ATFCL * Foreground colour 03 ATFRD PIC 9(4) COMP * Red (0-255) 03 ATFGN PIC 9(4) COMP * Green (0-255) 03 ATFBL PIC 9(4) COMP * Blue (0-255) 02 ATBCL * Background colour 03 ATBRD PIC 9(4) COMP * Red (0-255) 03 ATBGN PIC 9(4) COMP * Green (0-255) 03 ATBBL PIC 9(4) COMP * Blue (0-255) 02 ATACEL * Font cell size 03 ATACLX PIC 9(4,2) C * Width 1/10th mm (0=Use default) 03 ATACLY PIC 9(4,2) C * Depth 1/10th mm (0=Use default)

This routine overrides, or adds, the specified attribute in the Style-Block during printing. It does not overwrite the original Style-Block in your program. If the printer is closed and then reopened with the original Style-Block the original attributes will be retained. B$XPAT must be called after the printer has been opened and before it has been closed. See section 5 (Producing your own Style-Block) for further information regarding the cell and font size. Changing the cell size for attribute 0 is not advisable. The B$XPAT can also be used to add additional attributes to a standard style block during the printing of a report.

See Appendix E for a list of the STOP codes that can be generated by B$XPAT.

4. Standard In-built Style-Blocks The following Standard In-built Style-Blocks are currently available:

P132V100 PDF Output 132 column Vertical orientation using sysbackdrop1, version 00.

Technical Note IN343 Issue 33 Page 17 of 41 Extended PF Printing

P120V100 PDF Output 120 column Vertical orientation using sysbackdrop1, version 00

These Style-Blocks are described below.

4.1 P132V100 PDF 132 Column Vertical Style-Sheet with Sysbackdrop1; Version 00 This PDF output Style-Sheet is 132 characters wide by 96 lines deep. Using a default fixed pitch font, output is fully aligned at column positions. Output is printed on Sysbackdrop1, which contains a border confining a very light grey background. A divider separates Line 1 from Line 4. Lines 2 and 3 should not be printed on.

This Style-Sheet is the System Default Style-Sheet.

The Style-Sheet is monochrome, using a mixture of point sizes and darkened character backgrounds for emphasis. The Style-Sheet contains 4 attributes:

Attr 0 Normal Data 7 Point font Dark grey foreground Attr 1 Heading Line 1 8 Point font, V Dark grey foreground Attr 2 Heading Line 2 8 Point font, V Dark grey on mid-grey background Attr 3 Totals 8 Point Font V Dark grey on mid-grey background

4.2 P120V100 PDF 132 Column Vertical Style-Sheet with Sysbackdrop1; Version 00: This PDF output Style-Sheet is 120 characters wide by 85 lines deep. Other than changes to point sizes, this Style-Sheet is otherwise identical to P130V100. When using the default fixed pitch font, output is fully aligned at column positions. Output is printed on Sysbackdrop1, which contains a border confining a very light grey background. A divider separates Line 1 from Line 4. Lines 2 and 3 should not be printed on.

The Style-Sheet is monochrome, using a mixture of point sizes and darkened character backgrounds for emphasis. The Style-Sheet contains 4 attributes:

Attr 0 Normal Data 8 Point with Dark grey foreground Attr 1 Heading Line 1 9 Point with V Dark grey foreground Attr 2 Heading Line 2 9 Point with V Dark grey on light-grey background

Technical Note IN343 Issue 33 Page 18 of 41 Extended PF Printing

Attr 3 Totals 9 Point Font V Dark grey on light-grey background

5. Producing your own Style-Blocks The Style-Block is passed to GX at the commencement of report printing. It provides Print- Style information for the report, giving details of printable areas, fonts and colours, with the name of the optional backdrop image file. A default Style-Block is contained within the Extended PF Printing handler that allows standard PF based reports to be printed. Alternatively, the application program may provide the Style-Block at printer-open time.

The structure of the Style-Block is as follows:

01 PA 03 PAVERS PIC 9(2,2) C * Block version number = 1.01 VALUE 1.01 03 PANAME PIC X(8) * Name of this profile 03 PADCLX PIC 9(4,2) C * Default cell width 03 PADCLY PIC 9(4,2) C * Default cell height 03 PACNVS * Canvas (overall print region) info: 05 PAPTYP PIC X(32) * Paper type (A4, Letter, etc) 05 PASIZE * Printable size in 1/10th mm or 1/72 inch * (see PALUNIT) 07 PASIZX PIC 9(4) C * Width for Paper Type * e.g. 2100 for A4; 2300 for Letter 07 PASIZY PIC 9(4) C * Depth for Paper Type * e.g. 2970 for A4; 2750 for Letter 03 PABKDR * Backdrop info 05 PABNAM PIC X(64) * Image filename with subdirectory path 05 PABORG * Backdrop origin (top-left) 07 PABORX PIC 9(4) C * - X axis; vert in 1/10th mm or 1/72 inch * (see PALUNIT) 07 PABORY PIC 9(4) C * - Y axis; horiz in 1/10th mm or 1/72 inch * (see PALUNIT) 05 PABSZE * Backdrop dimensions 07 PABSZX PIC 9(4) C * - X axis; width in 1/10th mm or 1/72 inch * (see PALUNIT) 07 PABSZY PIC 9(4) C * - Y axis; depth in 1/10th mm or 1/72 inch * (see PALUNIT) 05 PABAOP * Backdrop alignment options 07 PABIMG PIC X * Image alignment property * “0” – Print as is (no stretch) * “1” – Stretch in proportion * “2” - Stretch to fit 07 PAVALG PIC X * Vertical alignment * “T” – Place at top * “C” – Centre * “R” – Place at right 07 PAHALG PIC X * Horizontal alignment * “L” – Place at top * “C” – Centre * “R” - Place at right

Technical Note IN343 Issue 33 Page 19 of 41 Extended PF Printing

05 PALUNIT PIC 9(2) C * Length unit for size/co-ordinate fields * 0 = 1/10th mm * 1 = 1/72 inch * All other values reserved for future use 03 PAPRNT * PF print region dimensions 05 PAPORG * Origin (top left) in 1/10th mm or 1/72 in * (see PALUNIT) 07 PAPORX PIC 9(4) C * X axis 07 PAPORY PIC 9(4) C * Y axis 05 PAPSZE * Size in 1/10th mm or 1/72 inch * (see PALUNIT) 07 PAPSZX PIC 9(4) C * Width 07 PAPSZY PIC 9(4) C * Depth 03 PAATRS * Attribute information 05 PAAALL PIC 9(4) C * Allocated Printer Attr recs in structure 05 PAAUSD PIC 9(4) C * No of Printer Attr recs supplied (0-31) 05 PAATTR OCCURS n * Attribute definition (one for each) 07 PAAOPT PIC 9(2) C * Type bit-flag * #80 0 = Font; 1= Image * #40 Reserved for future use * #20 Reserved for future use * #10 Reserved for future use * #08 Reserved for future use * #04 Reserved for future use * #02 Reserved for Transparent font attr * #01 Italics (for font attribute) 07 PAAF * Layout for font (Type 0) 08 PAAFON PIC X(64) * Font name 08 PAAWGT PIC 9(4) C * Weight 08 PAAPNT PIC 9(2) C * Point size 08 PAAFCL PIC 9(6) C * Foreground colour RGB 08 PAABCL PIC 9(6) C * Background colour RGB 08 PAACEL * Font cell size 09 PAACLX PIC 9(4,2) C * Width 1/10th mm or 1/72 inch (see PLUNIT) * 0 = Use default 09 PAACLY PIC 9(4,2) C * Depth 1/10th mm or 1/72 inch (see PLUNIT) * 0 = Use default * * The Image Attribute is only supported by GX V4.3, and later. * 01 PAAI REDEFINES PAAF * Layout for image 03 PAIDIR PIC X(64) * Image subdirectory (the actual filename * of the image is specified in the field * within the PF that contains the “image * attribute”) 03 PAIIMG PIC X * Image alignment property * “0” – Print as is (no stretch) * “1” – Stretch in proportion * “2” - Stretch to fit 03 PAIVAL PIC X * Vertical alignment * “T” – Place at top * “C” – Centre * “R” – Place at right 03 PAIHAL PIC X * Horizontal alignment * “L” – Place at top * “C” – Centre * “R” - Place at right

Technical Note IN343 Issue 33 Page 20 of 41 Extended PF Printing

03 FILLER PIC X(6) * Unused Set to LOW-VALUES 03 PAICLX PIC 9(4,2) C * Image width 1/10th mm or 1/72 inch * (see PALUNIT) 03 PAICLY PIC 9(4,2) C * Image depth 1/10th mm or 1/72 inch * (see PALUNIT)

The PA control block is available as copy-book $P in the S.SYS32 copy-library.

Field PACNVS describes the canvas around which the report has been designed. The block defines the page-size in pixels, defining the overall region in which all printing will occur.

PAPTYP gives the report’s preferred stationery type (such as “A4”), while PASIZE gives the stationery’s page width and depth in pixels at a nominal DPI count. We recommend that PASIZE is based on the recommended stationery dimensions (less printer margins) at 300 DPI resolution.

At run-time, GX builds each page at the resolution given by PASIZE. Before printing the page, GX rescales it to conform to the target printer’s DPI count as necessary. Note that PASIZE implies orientation. Where PASIZX exceeds PASIZY, orientation is landscape.

The Paper Size is controlled by the PASIZX and PASIZY fields. For example, for "A4" pages the values must be 2100 and 2970, respectively. Other values will be required for other Paper Sizes (e.g. 2300 and 2750, for "Letter"). Please refer to the "PaperSizeName" section in the PDF_In_The_Box on-line help for further details.

The sizes of some common Page Sizes are given in the following table:

PageSizeName Size in mm PASIZX value (if PASIZY value (if PALUNIT=0) PALUNIT=0) Letter 230 x 275 2300 2750 LetterSmall 230 x 279 2300 2790 A3 297 x 420 2970 4200 A4 210 x 297 2100 2970 A5 148 x 210 1480 2100 B4 250 x 354 2500 3540 B5 182 x 257 1820 2570

Note that (when PALUNIT=0) the PASIZx fields are in 1/10mm - multiply the mm sizes in the PDF_In_The_Box information by a scaling factor of 10.

All we have done so far is specify how a page is CONSTRUCTED. The canvas size specifies the area in pixels needed to construct the page in memory. The backdrop and font

Technical Note IN343 Issue 33 Page 21 of 41 Extended PF Printing descriptions are based on this assumed canvas size. Only when the entire page has been constructed in memory do we consider rescaling to match the printer.

The combination of printer DPI count and loaded stationery will often result in a printable area that is different to the area assumed by the Style-Block. GX will adjust the image to the printer’s print region, by rescaling the image either to fit exactly, or by rescaling to an integral factor, and then centring the resulting image.

PABKDR provides details of the Backdrop image file to be printed on each page. PABNAM is the name of the image file, while PABORG provides the origin i.e. top left-hand pixel position, at which the image is to be printed. The origin allows the backdrop to be positioned at a specific location on the canvas, which can be critical for form-print applications, and is useful to centre small images like watermarks.

The processing of the Image Filename and folder specified by the PABNAM field is fully described in Appendix A.

PAPRNT defines the print region within the canvas to which all PF print operations are directed. PAPORG specifies the origin (top-left-hand corner) of the printing zone. This allows the print region to be positioned at a specific point on the canvas, which can be useful for form-print applications and to print into a bordered area.

PAPSIZ specifies the size of the print region in pixels. It is used it to detect page boundary conditions, and calculate PF offsets.

The last section of the block defines a variable number of Print attributes, each of which specifies a font, point-size and colour combination. When a PF is printed, the Initialise PF operation associates an attribute with the invocation of the PF. All fields in the PF are then printed using the supplied attribute.

AT LEAST ONE PRINT ATTRIBUTE MUST BE SUPPLIED.

The first attribute in the block is known as attribute 0, which is used to print normal data. This attribute is key, as its cell size is used to construct a notional grid that controls page layout. By convention, the first 4 attribute numbers are used as follows:

0 Normal Data 1 Heading Line 1 2 Heading Line 2 3 Totals.

Technical Note IN343 Issue 33 Page 22 of 41 Extended PF Printing

Up to 32 Print Attributes can be defined.

Field PAAALL gives the number of attribute records allocated (but not necessarily supplied) in the block. Field PAAUSD gives the number of entries in use. The contents of print attribute entries beyond PAAUSD are undefined. PAAALL & PAAUSD MUST BOTH BE NONZERO. For most applications PAAALL and PAAUSD will contain the same (nonzero) value.

Each attribute specifies the following; PAAFON is a #00 terminated string containing the font name; PAAWGT and PAAPNT give the weight and point size of the selected font. PAAOPT contains font options. PAAFCL and PAABCL specify the foreground and background colours as RGB triplets. When the background colour triplet is all zero, the background is taken to be transparent.

The attribute also contains a character cell size in PAACEL. This specifies the notional character cell size used when mapping line and column numbers within the PF. The cell size field is only used by GX to calculate the position of under and over-scores, as field positions are otherwise supplied as pixel addresses.

Some example Style Blocks are described in Appendix C.

The Image File option in PAAOPT is only supported for GSM SP-23, and later.

5.1 Programming Note The cell size is used to calculate print start positions, thus constructing a grid to which line and column numbers are mapped. Cell size has no bearing on the number of characters that can be printed on a line, which is determined by the font size, the amount of space available, and, for proportional fonts, the actual size of the individual characters being printed. Precise column alignment is only possible using fixed pitch fonts. The Standard System Style-Sheets are all exactly column aligned when used with the default fixed pitch font, and are therefore compatible with existing PF based reports.

The cell size used for ALL the items in a PF is that of the default attribute for the PF. This cell size overrides the cell size of any attributes assigned to items in the PF.

5.2 Changes to Image Attributes for GX V4.4t For GX V4.4t, the handling of Image Attributes has been extended. By default, the name of the sub-folder (e.g. image_files) containing the image files is defined in PAIDIR with the name of the image file itself (e.g. myimage.bmp) in a data-field within the PF that contains

Technical Note IN343 Issue 33 Page 23 of 41 Extended PF Printing

the Attribute Number for the corresponding Image Attribute. For GX V4.4t, and later, both the name of the sub-folder and the image file name (e.g. image_files/myimage.bmp) can be specified in the data-field in which case the sub-folder defined in PAIDIR is ignored.

Positioning the image on the page can be challenging. More control of the positioning can be achieved by prefixing the filename or folder/filename with a string of this format:

|nnnnn|nnnnn|nnnnn|nnnnn|

i.e. 4 * 5-digit numbers separated by vertical-characters. All numeric strings must be exactly 5-digits i.e. leading zeroes must be supplied.

In summary, the image filename string can be any of the following:

“image.bmp” “folder\image.bmp” “|00036|02697|01000|00177|image.bmp” “|00036|02697|01000|00177|folder\image.bmp”

The 1st number (e.g. 00036) is the X-co-ordinate. Increase to move across the page. The 2nd number (e.g. 02697) is the Y-co-ordinate. Increase to move down the page. The 3rd number is the cell width. The 4th number is the cell depth. All units are 1/10th mm.

5.3 Changes to Page Geometry for GX V4.7f By default, the Unit Length for all dimension fields is 1/10mm (i.e. the PDF_in_the_Box LuTenth length unit option). For GX V4.7f, and later, the Unit Length for all dimension fields can be specified in 1/72 inch (the PDF_in_the_Box LuPoint length unit option). To switch from a 1/10mm co-ordinate system to a 1/72” system set the PALUNIT field, which was previously defined as a FILLER, to 1. Note that 1/72” is approximately 3.53 tenths of a millimetre so that, for example, the A4 paper size in points (i.e. 2100 * 2970, when PALUNIT=0) becomes 595 * 842 when PALUNIT=1.

6. New Exit Codes

EXIT Code Meaning 10101 Attempt to open printer failed. The backdrop file could not be located 10102 User Cancelled Print run without $PHLT set 10103 PDF printing not enabled on GX client computer. The PDF_In_The_Box or All_In_The_Box DLL must be installed on the GX computer. 10104 The preview facility not currently available on GX client. The Microsoft Preview facility has not yet been implemented and will result in this error.

Technical Note IN343 Issue 33 Page 24 of 41 Extended PF Printing

Appendix A – The Image Filename and Image Folder(s) The PABNAM and BKNAM fields must contain BOTH an “Image Folder” and an “Image Filename” (e.g. “folder1\backdrop27.jpg”). Note that this string is not zero-terminated. Do not supply either just a simple filename or a full pathname in these fields. For example:

C:\gsm\folder1\backdrop27.jpg * Invalid – full pathname gsm\folder1\backdrop27.jpg * Invalid – 2 folders specified backdrop27.jpg * Invalid – only a filename specified folder1\backdrop27.jpg * The only valid format

The Image Folder (and the various Image Files, within the Image Folder) is assumed to be in a sub-folder called “PFPrintImages” within the current Global folder. For example, if GSM is installed in C:\GSM and the PABNAM field contains “folder1\backdrop27.jpg” then the .jpg file must be in the following folder:

C:\GSM\PFPrintImages\folder1\backdrop27.jpg

Note that the default folder (e.g. “.\PFPrintImages”) can be over-ridden by the following registry setting:

HKEY_LOCAL_MACHINE\Software\Global\Client\Customisations\PFPrintImagesFold er

Although the Image Folder on the server (e.g. “C:\GSM\PFPrintImages\folder1”) contains files that are ultimately used by the GX client, neither the Image Folder nor the “PFPrintImages” folder (or the customised equivalent) need to be share-able. The various Image Files are automatically down-loaded from the server to the GX PC when required, on a demand basis using the GXCOP$ FTP protocol. Important note: Unlike some other GX file download mechanisms, stale copies of files downloaded to the GX PC’s are NOT automatically refreshed when a newer version is available on the server. If a new version of a backdrop file is produced it should be renamed – the application code that establishes the name of the backdrop file should allow for the filename to be easily customised. For example, the backdrop files specified by Global-3000 are customised in the System Parameters.

An “Images Folder” is required otherwise applications would have to code the absolute pathname of the various images files in PABNAM and BKNAM. Absolute pathnames would lead to non-portable applications.

Technical Note IN343 Issue 33 Page 25 of 41 Extended PF Printing

The two-tier “Images Folder” (i.e. the first level folder specified by the PFPrintImagesFolder registry setting (or “.\PFPrintImages as the default); and the second level folder contained within the application code) allows for several Image Files with the same name to be kept in separate module-specific Image Folders. For example:

C:\GSM\PFPrintImages\Global3000\backdrop1.jpg C:\GSM\PFPrintImages\Payroll\backdrop1.jpg

The second level of the two-tier “Images Folder” is application-specific. The following folder names are reserved and should not be used by external developers:

Global3000 Reserved for use by Global-3000 Payroll73 Reserved for use by Global Payroll V7.3 Payroll74 Reserved for use by Global Payroll V7.4 Payroll* Reserved for future versions of Global Payroll

Appendix B - GX.INI File Settings for Extended PF Printing The only GX.INI file settings that apply to the Extended PF Printing option are in the following section:

[pfprint]

PFPrintStaleFileTimeout=0

This setting specifies the minimum amount of time (in minutes) a print file will remain in the temporary folder before it is deleted. The default value is zero which means the automatic deletion of print files is disabled.

If this setting is absent, or set to 0, any print reports that are printed repeatedly will gradually fill the directory. Note that no print report is ever overwritten because GX automatically adds an incrementing index number to the print file name to avoid name clashes (e.g. first print of a report named "REPORT" gives the name REPORT.PDF; the next will be REPORT(1).PDF; the next REPORT(2).PDF, etc.).

UseAllInTheBoxInternalViewer

This setting can be used to disable the internal viewer that is included with the All_In_The_Box DLL. Note that this option is ignored if the PDF_In_The_Box.DLL is employed.

Technical Note IN343 Issue 33 Page 26 of 41 Extended PF Printing

The following additional settings are only meaningful when the All_In_The_Box DLL is used. Using these options with the PDF_In_The_Box DLL will produce unpredictable results.

For GX V4.4m, the following settings in the [pfprint] section of the GX.INI file are recognised when the PDF file is printed directly to a printer:

SelectPrinter If this setting is enabled a Printer selection dialogue box will normally appear to allow the printer to be changed from the Windows default printer. Note that the Printer selection dialogue box will NOT be displayed if a specific Windows printer has been selected using the XPSPIN field (see section 3.1.2);

For GX V4.4n, the following settings in the [pfprint] section of the GX.INI file are recognised when the PDF file is printed directly to a printer:

SelectPaperTray If this setting is enabled a Paper Tray selection dialogue box will appear to allow the paper tray to be selected;

PaperTray1 The name of the 1st Paper Tray for the default Windows printer. This tray is used when the 1st character of XPOPT is set to “1” (see section 3.1.2)

PaperTray2 The name of the 2nd Paper Tray for the default Windows printer. This tray is used when the 1st character of XPOPT is set to “2” (see section 3.1.2)

PaperTray3 The name of the 3rd Paper Tray for the default Windows printer. This tray is used when the 1st character of XPOPT is set to “3” (see section 3.1.2)

For GX V4.4u, the following settings in the [pfprint] section of the GX.INI file are recognised when the PDF file is printed directly to a printer AND when the “SelectPrinter” option is enabled:

PrinterName1 The name of a Windows printer. This printer is used when XPSPIN is set to 1 (see section 3.1.2)

PrinterName2 The name of a Windows printer. This printer is used when XPSPIN is set to 2 (see section 3.1.2)

Technical Note IN343 Issue 33 Page 27 of 41 Extended PF Printing

PrinterName3 The name of a Windows printer. This printer is used when XPSPIN is set to 3 (see section 3.1.2)

PrinterName4 The name of a Windows printer. This printer is used when XPSPIN is set to 4 (see section 3.1.2)

PrinterName5 The name of a Windows printer. This printer is used when XPSPIN is set to 5 (see section 3.1.2)

PrinterName6 The name of a Windows printer. This printer is used when XPSPIN is set to 6 (see section 3.1.2)

PrinterName7 The name of a Windows printer. This printer is used when XPSPIN is set to 7 (see section 3.1.2)

PrinterName8 The name of a Windows printer. This printer is used when XPSPIN is set to 8 (see section 3.1.2)

PrinterName9 The name of a Windows printer. This printer is used when XPSPIN is set to 9 (see section 3.1.2)

Some readers may be surprised that no GX.INI file settings are available to specify the folders used to hold print files and images. These folders are hard-coded into GX. All print files are created in the PFPRINT sub-folder of the GX folder. Within this subdirectory there are three further directories:

TEMP where the print files are created. This folder can be specified by the special string “%XPPDF” in path-names supplied to the EMAIL$ sub- routine;

IMAGES which stores any backdrops and image files;

KEPT which is used to archive print files.

NOPRINT\n which is used to store print files created with the “No Print” option (where n is the Partition Number from 1 to 9)

These directories are automatically created by GX when a GX session is started if they don't already exist.

Technical Note IN343 Issue 33 Page 28 of 41 Extended PF Printing

The following table describes where the print files will appear:

XPOPT value Print file location PD TEMP only RD TEMP only ND Copied from TEMP to NOPRINT\n PP Moved from TEMP to KEPT RP Moved from TEMP to KEPT NP Copied from TEMP to NOPRINT\n; Moved from TEMP to KEPT

The following settings in the [pfprint] section of GX.INI can be used to delete files from the above temporary folders:

Setting Description Version of GX AutoDeleteTempFolderOnStartUp Deletes all files in the 4.2m PFPFRINT\TEMP subfolder when GX partition 1 starts on initial login. AutoDeleteNoPrintFolderOnStartUp Deletes all files in the 4.4h PFPFRINT\NOPRINT\n subfolder when GX partition n starts.

Appendix C – Some Example Style-Blocks The following example Style Blocks can be used as templates for use when constructing the complex PA block:

** ** DEFAULT STYLE BLOCK P132V100 FOR PDF ** ** PORTRAIT LAYOUT 132 CHRS WIDE BY 96 LINES USING THE ** Courier new FIXED PITCH FONT (SMALL 'n'). ** ** PRINTS ONTO BACKDROP "Sysbackdrop1.jpg", A GENERAL PURPOSE BACKDROP. ** ** LINES 2 AND 3 SHOULD NOT BE PRINTED ON. ** ** OUTPUT IS FULLY ALIGNED AT COLUMN POSITIONS. THIS STYLE SHEET IS ** THEREFORE COMPATIBLE WITH EXISTING REPORT LAYOUTS. ** ** STYLE BLOCK. DEFINES PRINT-STYLE PARAMETERS FOR A GROUP OF ** REPORTS. STATIONERY TYPE, EG A4, IS SUPPLIED WITH PRINTABLE SIZE ** IN PIXELS. THIS IMPLIES PAGE ORIENTATION AND PRINTER DPI COUNT. ** ** PABKDR SPECIFIES THE BACKDROP IMAGE FILE TO BE PRINTED ON EACH ** PAGE AT OFFSET PABORG. PAPRNT LOCATES THE PRINT REGION WITHIN

Technical Note IN343 Issue 33 Page 29 of 41 Extended PF Printing

** THE STATIONERY AT ORIGIN PAPORG. ** ** THE BLOCK CONTAINS PAAUSD ATTRIBUTES, WHICH SPECIFY FONT AND ** COLOUR COMBINATIONS TO BE USED FOR ALL FIELDS IN A PF PRINT ** OPERATION. ** ** BLOCK LEN = 140b + 80b PER ATTRIBUTE ENTRY. ** ** IMAGE ALIGNMENT PROPERTIES BYTE 1 "0" = PRINT AS IS (NO STRETCH) ** PABAOP AND PAIAOP.. "1" = STRETCH IN PROPORTION ** "2" = STRETCH TO FIT ** ** - Vert Alignment.. BYTE 2 "T" = PLACE AT TOP ** "C" = CENTER ** "B" = PLACE AT BOTTOM ** ** - Horizontal Alignment.. BYTE 3 "L" = PLACE AT LEFT ** "C" = CENTER ** "R" = PLACE AT RIGHT ** ** PABNAM CONTAINS THE DIRECTORY & NAME OF THE BACKDROP FILE, EG ** "\Backdropimages\Sysbackdrop1.jpg". Omitting the root directory. ** The remote root name is added by GX when it retrieves the file. ** ** PAIDIR CONTAINS THE IMAGE DIRECTORY NAME ONLY. EG "\Sysimage" ** THE REMOTE ROOT DIRECTORY IS AGAIN ADDED BY GX, WHILE THE IMAGE ** FILE NAME IS APPENDED BY GX FROM THE NOTIONAL FIELD CONTENTS. ** ******************************************************************************* * * 01 P1 03 P1VERS PIC 9(2,2) C * STYLE BLOCK VERSION NUMBER = 1.01 VALUE 1.01 * 03 P1NAME PIC X(8) * NAME OF THIS PROFILE VALUE "P132V100" * - PDF OUTPUT * - 120 CHAR WIDE * - VERTICAL (PORTRAIT) ORIENTATION * - BACKDROP 1 * - VERSION 00 * 03 P1DCLX PIC 9(4,2) C * DEFAULT CELL WIDTH VALUE 14.82 03 P1DCLY PIC 9(4,2) C * DEFAULT CELL HEIGHT VALUE 30 * 03 P1CNVS * CANVAS (OVERALL PRINT REGION) INFO: 05 P1PTYP PIC X(32) * PAPER TYPE (A4, LETTER, ETC) VALUE "A4" 05 P1SIZE * PRINTABLE SIZE IN 1/10th mm 07 P1SIZX PIC 9(4) C * - WIDTH FOR PDF MUST BE 2100 VALUE 2100 07 P1SIZY PIC 9(4) C * - DEPTH FOR PDF MUST BE 2970 VALUE 2970 * 03 P1BKDR * BACKDROP INFO 05 P1BNAM PIC X(64) * IMAGE FILENAME (INCL VERS#)

Technical Note IN343 Issue 33 Page 30 of 41 Extended PF Printing

VALUE "Sysbackdrops\Sysbackdrop1.jpg" 05 P1BORG * BACKDROP ORIGIN (TOP-LEFT) 07 P1BORX PIC 9(4) C * - X AXIS; VERT IN 1/10th mm 07 P1BORY PIC 9(4) C * - Y AXIS; HORIZ IN 1/10th mm 05 P1BSZE * BACKDROP DIMENSIONS 07 P1BSZX PIC 9(4) C * - X AXIS; WIDTH IN 1/10th mm VALUE 2100 07 P1BSZY PIC 9(4) C * - Y AXIS; DEPTH IN 1/10th mm VALUE 2970 05 P1BAOP PIC X(3) * BACKDROP ALIGNMENT OPTIONS VALUE "2CC" * STRETCH TO FIT (CC MEANINGLESS) 05 FILLER PIC 9(2) C * UNUSED #00 * 03 P1PRNT * PF PRINT REGION DIMENSIONS 05 P1PORG * ORIGIN IN 1/10th mm (TOP-LEFT) 07 P1PORX PIC 9(4) C * - X AXIS VALUE 75 07 P1PORY PIC 9(4) C * - Y AXIS VALUE 56 05 P1PSZE * SIZE IN 1/10th mm 07 P1PSZX PIC 9(4) C * - WIDTH (2100 - (2x75)) VALUE 1950 07 P1PSZY PIC 9(4) C * - DEPTH (2970 - (2x56)) VALUE 2858 * 03 P1ATRS * ATTRIBUTE INFORMATION 05 P1AALL PIC 9(4) C * ALLOCATED TR RECS IN STRUCTURE VALUE 4 05 P1AUSD PIC 9(4) C * NO OF P1ATTR RECS SUPPLIED VALUE 4 * * (140b TO HERE) * Attribute 0 - Normal Data .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image. * FOR FONT(b1=Italics, b2=Transprnt) 07 FILLER * LAYOUT FOR FONT (TYPE 0) 08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 7 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #3F3F3F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #FFFFFF 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) * * Attribute 1 - Header Line 1 .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image. * FOR FONT(b1=Italics, b2=Transprnt) 07 FILLER * LAYOUT FOR FONT (TYPE 0)

Technical Note IN343 Issue 33 Page 31 of 41 Extended PF Printing

08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 8 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #2F2F2F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #FFFFFF 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) * * Attribute 2 - Header Line 2 .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image. 07 FILLER * LAYOUT FOR FONT (TYPE 0) 08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 8 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #2F2F2F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #D0D0D0 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) * * Attribute 3 - Totals .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image. 07 FILLER * LAYOUT FOR FONT (TYPE 0) 08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 8 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #2F2F2F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #D0D0D0 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) * * 07 P1AI REDEFINES P1AF * ATTRIBUTE REDEF FOR IMAGES * 09 P1IDIR PIC X(64) * SOURCE & TARGET DIRECTORY * 09 P1IAOP PIC X(3) * IMAGE ALIGNMENT OPTIONS.. * 09 FILLER PIC X(6) * UNUSED #00 * 09 P1ICLX PIC 9(4,2) C * IMAGE WIDTH 1/10th mm

Technical Note IN343 Issue 33 Page 32 of 41 Extended PF Printing

* 09 P1ICLY PIC 9(4,2) C * IMAGE DEPTH 1/10th mm * * ENTRY LENGTH = 80 BYTES ******************************************************************************* ** ** ** DEFAULT STYLE BLOCK P120V100 - PDF ONLY. ** ** PORTRAIT LAYOUT 120 CHRS WIDE BY 85 LINES USING THE ** Courier new FIXED PITCH FONT (SMALL 'n'). ** ** PRINTS ONTO BACKDROP "Sysbackdrop1.jpg" A GENERAL PURPOSE BACKDROP. ** ** LINES 2 AND 3 SHOULD NOT BE PRINTED ON. ** ** OUTPUT IS FULLY ALIGNED AT COLUMN POSITIONS. THIS STYLE SHEET IS ** THEREFORE COMPATIBLE WITH EXISTING REPORT LAYOUTS. ** ** STYLE BLOCK. DEFINES PRINT-STYLE PARAMETERS FOR A GROUP OF ** REPORTS. STATIONERY TYPE, EG A4, IS SUPPLIED WITH PRINTABLE SIZE ** IN PIXELS. THIS IMPLIES PAGE ORIENTATION AND PRINTER DPI COUNT. ** ** PABKDR SPECIFIES THE BACKDROP IMAGE FILE TO BE PRINTED ON EACH ** PAGE AT OFFSET PABORG. PAPRNT LOCATES THE PRINT REGION WITHIN ** THE STATIONERY AT ORIGIN PAPORG. ** ** THE BLOCK CONTAINS PAAUSD ATTRIBUTES, WHICH SPECIFY FONT AND ** COLOUR COMBINATIONS TO BE USED FOR ALL FIELDS IN A PF PRINT ** OPERATION. ** ** BLOCK LEN = 140b + 80b PER ATTRIBUTE ENTRY. ** ** IMAGE ALIGNMENT PROPERTIES BYTE 1 "0" = PRINT AS IS (NO STRETCH) ** PABAOP AND PAIAOP.. "1" = STRETCH IN PROPORTION ** "2" = STRETCH TO FIT ** ** - Vert Alignment.. BYTE 2 "T" = PLACE AT TOP ** "C" = CENTER ** "B" = PLACE AT BOTTOM ** ** - Horizontal Alignment.. BYTE 3 "L" = PLACE AT LEFT ** "C" = CENTER ** "R" = PLACE AT RIGHT ** ** PABNAM CONTAINS THE DIRECTORY & NAME OF THE BACKDROP FILE, EG ** "\Backdropimages\Sysbackdrop1.jpg". Omitting the root directory. ** The remote root name is added by GX when it retrieves the file. ** ** PAIDIR CONTAINS THE IMAGE DIRECTORY NAME ONLY. EG "\Sysimage" ** THE REMOTE ROOT DIRECTORY IS AGAIN ADDED BY GX, WHILE THE IMAGE ** FILE NAME IS APPENDED BY GX FROM THE NOTIONAL FIELD CONTENTS. ** ******************************************************************************* * 01 P2 03 P2VERS PIC 9(2,2) C * STYLE BLOCK VERSION NUMBER = 1.01 VALUE 1.01 * 03 P2NAME PIC X(8) * NAME OF THIS PROFILE

Technical Note IN343 Issue 33 Page 33 of 41 Extended PF Printing

VALUE "P120V100" * - PDF OUTPUT * - 120 CHAR WIDE * - VERTICAL (PORTRAIT) ORIENTATION * - BACKDROP 1 * - VERSION 00 * 03 P2DCLX PIC 9(4,2) C * DEFAULT CELL WIDTH VALUE 16.94 03 P2DCLY PIC 9(4,2) C * DEFAULT CELL HEIGHT VALUE 34 * 03 P2CNVS * CANVAS (OVERALL PRINT REGION) INFO: 05 P2PTYP PIC X(32) * PAPER TYPE (A4, LETTER, ETC) VALUE "A4" 05 P2SIZE * PRINTABLE SIZE IN 1/10th mm 07 P2SIZX PIC 9(4) C * - WIDTH FOR PDF MUST BE 2100 VALUE 2100 07 P2SIZY PIC 9(4) C * - DEPTH FOR PDF MUST BE 2970 VALUE 2970 * 03 P2BKDR * BACKDROP INFO 05 P2BNAM PIC X(64) * IMAGE FILENAME (INCL VERS#) VALUE "Sysbackdrops\Sysbackdrop1.jpg" 05 P2BORG * BACKDROP ORIGIN (TOP-LEFT) 07 P2BORX PIC 9(4) C * - X AXIS; VERT IN 1/10th mm 07 P2BORY PIC 9(4) C * - Y AXIS; HORIZ IN 1/10th mm 05 P2BSZE * BACKDROP DIMENSIONS 07 P2BSZX PIC 9(4) C * - X AXIS; WIDTH IN 1/10th mm VALUE 2100 07 P2BSZY PIC 9(4) C * - Y AXIS; DEPTH IN 1/10th mm VALUE 2970 05 P2BAOP PIC X(3) * BACKDROP ALIGNMENT OPTIONS VALUE "2CC" * STRETCH TO FIT (CC MEANINGLESS) 05 FILLER PIC 9(2) C * UNUSED #00 * 03 P2PRNT * PF PRINT REGION DIMENSIONS 05 P2PORG * ORIGIN IN 1/10th mm (TOP-LEFT) 07 P2PORX PIC 9(4) C * - X AXIS VALUE 36 07 P2PORY PIC 9(4) C * - Y AXIS VALUE 56 05 P2PSZE * SIZE IN 1/10th mm 07 P2PSZX PIC 9(4) C * - WIDTH VALUE 2028 07 P2PSZY PIC 9(4) C * - DEPTH VALUE 2858 * 03 P2ATRS * ATTRIBUTE INFORMATION 05 P2AALL PIC 9(4) C * ALLOCATED TR RECS IN STRUCTURE VALUE 4 05 P2AUSD PIC 9(4) C * NO OF P2ATTR RECS SUPPLIED VALUE 4 * * (140b TO HERE) * Attribute 0 - Normal Data .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image.

Technical Note IN343 Issue 33 Page 34 of 41 Extended PF Printing

* FOR FONT(b1=Italics, b2=Transprnt) 07 FILLER * LAYOUT FOR FONT (TYPE 0) 08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 8 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #3F3F3F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #FFFFFF 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) * * Attribute 1 - Header Line 1 .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image. * FOR FONT(b1=Italics, b2=Transprnt) 07 FILLER * LAYOUT FOR FONT (TYPE 0) 08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 9 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #2F2F2F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #FFFFFF 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) * * * Attribute 2 - Header Line 2 .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image. 07 FILLER * LAYOUT FOR FONT (TYPE 0) 08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 9 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #2F2F2F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #D0D0D0 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) * * Attribute 3 - Totals .. *

Technical Note IN343 Issue 33 Page 35 of 41 Extended PF Printing

05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image. 07 FILLER * LAYOUT FOR FONT (TYPE 0) 08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 9 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #2F2F2F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #D0D0D0 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) * * 07 P2AI REDEFINES P2AF * ATTRIBUTE REDEF FOR IMAGES * 09 P2IDIR PIC X(64) * SOURCE & TARGET DIRECTORY * 09 P2IAOP PIC X(3) * IMAGE ALIGNMENT OPTIONS.. * 09 FILLER PIC X(6) * UNUSED #00 * 09 P2ICLX PIC 9(4,2) C * IMAGE WIDTH 1/10th mm * 09 P2ICLY PIC 9(4,2) C * IMAGE DEPTH 1/10th mm * * ENTRY LENGTH = 80 BYTES ******************************************************************************* ** ** STYLE BLOCK P120V1TS - PDF ONLY. ** ** PORTRAIT LAYOUT 120 CHRS WIDE BY 85 LINES USING THE ** Courier new FIXED PITCH FONT (SMALL 'n'). ** ** PRINTS ONTO BACKDROP "Sysbackdrop1.jpg" A GENERAL PURPOSE BACKDROP. ** ** LINES 2 AND 3 SHOULD NOT BE PRINTED ON. ** ** OUTPUT IS FULLY ALIGNED AT COLUMN POSITIONS. THIS STYLE SHEET IS ** THEREFORE COMPATIBLE WITH EXISTING REPORT LAYOUTS. ** ** STYLE BLOCK. DEFINES PRINT-STYLE PARAMETERS FOR A GROUP OF ** REPORTS. STATIONERY TYPE, EG A4, IS SUPPLIED WITH PRINTABLE SIZE ** IN PIXELS. THIS IMPLIES PAGE ORIENTATION AND PRINTER DPI COUNT. ** ** PABKDR SPECIFIES THE BACKDROP IMAGE FILE TO BE PRINTED ON EACH ** PAGE AT OFFSET PABORG. PAPRNT LOCATES THE PRINT REGION WITHIN ** THE STATIONERY AT ORIGIN PAPORG. ** ** THE BLOCK CONTAINS PAAUSD ATTRIBUTES, WHICH SPECIFY FONT AND ** COLOUR COMBINATIONS TO BE USED FOR ALL FIELDS IN A PF PRINT ** OPERATION. ** ** BLOCK LEN = 140b + 80b PER ATTRIBUTE ENTRY. ** ** IMAGE ALIGNMENT PROPERTIES BYTE 1 "0" = PRINT AS IS (NO STRETCH) ** PABAOP AND PAIAOP.. "1" = STRETCH IN PROPORTION ** "2" = STRETCH TO FIT ** ** - Vert Alignment.. BYTE 2 "T" = PLACE AT TOP

Technical Note IN343 Issue 33 Page 36 of 41 Extended PF Printing

** "C" = CENTER ** "B" = PLACE AT BOTTOM ** ** - Horizontal Alignment.. BYTE 3 "L" = PLACE AT LEFT ** "C" = CENTER ** "R" = PLACE AT RIGHT ** ** PABNAM CONTAINS THE DIRECTORY & NAME OF THE BACKDROP FILE, EG ** "\Backdropimages\Sysbackdrop1.jpg". Omitting the root directory. ** The remote root name is added by GX when it retrieves the file. ** ** PAIDIR CONTAINS THE IMAGE DIRECTORY NAME ONLY. EG "\Sysimage" ** THE REMOTE ROOT DIRECTORY IS AGAIN ADDED BY GX, WHILE THE IMAGE ** FILE NAME IS APPENDED BY GX FROM THE NOTIONAL FIELD CONTENTS. ** ******************************************************************************* * 01 P9 03 P9VERS PIC 9(2,2) C * STYLE BLOCK VERSION NUMBER = 1.01 VALUE 1.01 * 03 P9NAME PIC X(8) * NAME OF THIS PROFILE VALUE "P120V1TS" * - PDF OUTPUT * - 120 CHAR WIDE * - VERTICAL (PORTRAIT) ORIENTATION * - BACKDROP 1 * - VERSION 00 * 03 P9DCLX PIC 9(4,2) C * DEFAULT CELL WIDTH VALUE 17 03 P9DCLY PIC 9(4,2) C * DEFAULT CELL HEIGHT VALUE 34 * 03 P9CNVS * CANVAS (OVERALL PRINT REGION) INFO: 05 P9PTYP PIC X(32) * PAPER TYPE (A4, LETTER, ETC) VALUE "A4" 05 P9SIZE * PRINTABLE SIZE IN 1/10th mm 07 P9SIZX PIC 9(4) C * - WIDTH FOR PDF MUST BE 2100 VALUE 2100 07 P9SIZY PIC 9(4) C * - DEPTH FOR PDF MUST BE 2970 VALUE 2970 * 03 P9BKDR * BACKDROP INFO 05 P9BNAM PIC X(64) * IMAGE FILENAME (INCL VERS#) VALUE "Sysbackdrops\Sysbackdrop1.jpg" 05 P9BORG * BACKDROP ORIGIN (TOP-LEFT) 07 P9BORX PIC 9(4) C * - X AXIS; VERT IN 1/10th mm 07 P9BORY PIC 9(4) C * - Y AXIS; HORIZ IN 1/10th mm 05 P9BSZE * BACKDROP DIMENSIONS 07 P9BSZX PIC 9(4) C * - X AXIS; WIDTH IN 1/10th mm VALUE 2100 07 P9BSZY PIC 9(4) C * - Y AXIS; DEPTH IN 1/10th mm VALUE 2970 05 P9BAOP PIC X(3) * BACKDROP ALIGNMENT OPTIONS VALUE "2CC" * STRETCH TO FIT (CC MEANINGLESS) 05 FILLER PIC 9(2) C * UNUSED #00 * 03 P9PRNT * PF PRINT REGION DIMENSIONS

Technical Note IN343 Issue 33 Page 37 of 41 Extended PF Printing

05 P9PORG * ORIGIN IN 1/10th mm (TOP-LEFT) 07 P9PORX PIC 9(4) C * - X AXIS VALUE 36 07 P9PORY PIC 9(4) C * - Y AXIS VALUE 56 05 P9PSZE * SIZE IN 1/10th mm 07 P9PSZX PIC 9(4) C * - WIDTH VALUE 2028 07 P9PSZY PIC 9(4) C * - DEPTH VALUE 2858 * 03 P9ATRS * ATTRIBUTE INFORMATION 05 P9AALL PIC 9(4) C * ALLOCATED TR RECS IN STRUCTURE VALUE 5 05 P9AUSD PIC 9(4) C * NO OF P9ATTR RECS SUPPLIED VALUE 5 * * (140b TO HERE) * Attribute 0 - Normal Data .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image. * FOR FONT(b1=Italics, b2=Transprnt) 07 FILLER * LAYOUT FOR FONT (TYPE 0) 08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 8 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #3F3F3F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #FFFFFF 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) * * Attribute 1 - Header Line 1 .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image. * FOR FONT(b1=Italics, b2=Transprnt) 07 FILLER * LAYOUT FOR FONT (TYPE 0) 08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 9 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #2F2F2F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #FFFFFF 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) * *

Technical Note IN343 Issue 33 Page 38 of 41 Extended PF Printing

* Attribute 2 - Header Line 2 .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image. 07 FILLER * LAYOUT FOR FONT (TYPE 0) 08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 9 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #2F2F2F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #D0D0D0 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) * * Attribute 3 - Totals .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC 9(2) C * TYPE b8 (Sign) 0 = Font; 1= Image. 07 FILLER * LAYOUT FOR FONT (TYPE 0) 08 FILLER PIC X(64) * FONT NAME VALUE "Courier New" 08 FILLER PIC 9(4) C * WEIGHT VALUE 800 08 FILLER PIC 9(2) C * POINT SIZE VALUE 9 08 FILLER PIC 9(6) C * FOREGROUND COLOR RGB VALUE #2F2F2F 08 FILLER PIC 9(6) C * BACKGROUND COLOR RGB VALUE #D0D0D0 08 FILLER * FONT CELL SIZE 09 FILLER PIC 9(4,2) C * - WIDTH 1/10th mm (0=USE DEFAULT) 09 FILLER PIC 9(4,2) C * - DEPTH 1/10th mm (0=USE DEFUALT) VALUE 50 * * Attribute 4 - Image .. * 05 FILLER * ATTRIBUTE DEFINITION 07 FILLER PIC X * TYPE b8 (Sign) 0 = Font; 1= Image. VALUE #80 07 P9IDIR PIC X(64) * SOURCE & TARGET DIRECTORY VALUE "Barcellos" * - BARCELLOS SUBDIRECTORY. 07 P9IAOP PIC X(3) * IMAGE ALIGNMENT OPTIONS.. VALUE "1CC" * - PROP STRETCH CENTER ALL ROUND. 07 FILLER PIC X(6) * UNUSED #00 VALUE LOW-VALUES 07 P9ICLX PIC 9(4,2) C * IMAGE WIDTH 1/10th mm VALUE 1000 07 P9ICLY PIC 9(4,2) C * IMAGE DEPTH 1/10th mm VALUE 1200 * ENTRY LENGTH = 80 BYTES

Appendix D – Trouble Shooting

Technical Note IN343 Issue 33 Page 39 of 41 Extended PF Printing

GX.EXE invokes the PDF_In_The_Box.DLL or All_In_The_Box.DLL to perform most of the PDF creation and printing functions. If any of these calls to the external DLL fail the PDF file will not be created with no indication of the cause of the problem. Under these conditions GX will automatically create to following log file in the current GX folder: PDFERRORLOG.TXT. For example, the following log file will be created if the raster “Courier” font is incorrectly used instead of a TrueType font (such as “Courier New”):

This font is not TrueType: Courier reported by TextOut File not found: C:\PROGRA~1\OO3K\PFPRINT\TEMP\SORD0007 (1).PDF reported by Show

This log file should be examined and, if necessary, sent to Global Support, if any unexpected problems in Extended PDF Printing are encountered.

Appendix E – STOP Codes The following STOP codes can be generated by the Extended PF Printing mechanism and related sub-routines:

Stop Code Routine Description 25514 B$XPF The Speedbase PF structure exceeds 16 levels. An attempt has been made to execute a PF construct with more than 16 levels of headers or trailers using the PRINT statement. The PF statement may specify a PF as a header or trailer, and this PF may itself specify a further PF as a header or trailer. However, this is limited to a maximum of 16 levels of PFs. 25381 B$XPF Extended printing has attempted to transfer an Invalid number of bytes to GX. This may be due to data corruption. 25382 B$XPF The length of the PF and the fields is too large for extended printing to pass to GX. 25383 B$PFUP The version number of the PA block passed to the B$PFUP routine is too high. 25384 B$XPF The extended printing DLM has not been present in memory throughout the printing session. The application must not EXEC a program to print individual lines. 25385 B$XPF Extended printing has suffered an exception because the print file contains more than 255 unique PF blocks. 25386 B$XPF Extended PF printing has suffered a page dimensions error. 25387 B$XPAT The B$XPAT routine has been called with an invalid attribute number. 25388 B$XPAT An attribute number not in the range 0 to 31 has been passed to the B$XPAT routine.

Technical Note IN343 Issue 33 Page 40 of 41 Extended PF Printing

25389 B$XPAT The printer was not opened when B$XPAT was called. 25390 B$XPO An attempt has been made to open a GX printing session when one is already open. 25391 B$XPO The style block parameter passed to the GX open printer routine is too large. 25392 B$XPPX A field passed to GX printing was found to be of an invalid type. 25393 B$XPF The size of the data block passed to GX by the printing routine has exceeded 8K. 25394 B$XLC A close was attempted on GX printer that was not open. 25395 B$XPO GX printing was attempted when GX was not running. 25396 B$XPO The version number of the Style Block passed to the B$XPO is not supported. 25397 B$XPO The version number of the style block passed to the B$XPO routine was incompatible. 25398 B$XPAT B$XPAT was not called on a GX client. 25399 B$XPAT The AT block passed to the B$XPAT routine contains an invalid version number.

Technical Note IN343 Issue 33 Page 41 of 41

Recommended publications