WINPRINT-SET-LINES-PER-PAGE

This operation code sets the number of lines that should be printed on a page.

Usage

CALL "WIN$PRINTER"
    USING WINPRINT-SET-LINES-PER-PAGE, WINPRINT-DATA
    GIVING RESULT

Parameters

WINPRINT-DATA Group item defined in winprint.def as follows:
01 WINPRINT-DATA.
   03 WPRTDATA-SET-STD-FONT.
   03 WPRT-PAGE-LAYOUT REDEFINES 
      WPRTDATA-SET-STD-FONT.
      05 WPRTDATA-LINES-PER-PAGE       UNSIGNED-SHORT.
      05 WPRTDATA-COLUMNS-PER-PAGE     UNSIGNED-SHORT.

Description

Printing forms using the Windows spooler is sometimes difficult because you cannot easily control the height of a chosen font. Most Windows fonts do not conform to older standards about font height. For example, 12 point Courier does not necessarily print at 6 lines per inch. You can use the WINPRINT-GET-PAGE-LAYOUT operation to determine the number of lines that fit on a page for a given font. Sometimes, however, you need to be able to set the line height explicitly.

This operation allows you to do that. It sets the number of lines that should be printed on a page. The runtime uses this number to adjust the height of the printed font. Note that the font is not scaled--it is simply printed in the specified vertical space.

In order to specify the number of lines that will fit on a page, you must consider the height or vertical resolution of each line. WINPRINT-SET-LINES-PER-PAGE obtains the page height, calculates the physical margins of the page, and sets the font height. The value of the font height includes the visible height of a letter plus its top and bottom margins. If your font height is 7 dots-per-inch (dpi), this includes the top and bottom margins of the font itself, so the actual font height might be only 5 dpi. Note that these values differ from font to font.

When using this option, set the number of lines desired in WPRTDATA-LINES-PER-PAGE (also defined in winprint.def). Then pass WINPRINT-DATA to the routine. For example:

     * Set 60 lines per page 
          MOVE 60 TO WPRTDATA-LINES-PER-PAGE 
          CALL "WIN$PRINTER" 
             USING WINPRINT-SET-LINES-PER-PAGE,
             WINPRINT-DATA

You can set the lines per page with the spooler open or closed. If you set it when it is open, then the new font height takes effect the next time the page position is advanced. In either case, the lines per page is reset to the default value the next time the spooler is closed. You can explicitly reset to the default font height by setting WPRTDATA-LINES-PER-PAGE to zero.

Note: We do not recommend using this operation when printing with -P SPOOLER-DIRECT or -Q printername DIRECT=ON. When you print in DIRECT mode, the Windows print spooler has no control over the printer, the printer is not initialized by the Windows printer driver. This means that the print job uses the hardware defaults. For example, if you print in DIRECT mode to a printer with the hardware default paper size set to US letter format, that is the format used, even if the driver has A4 paper set as the default. In this situation, the operation is likely to return incorrect values.