Setting Options

You may also use -Q printername to set several other printing options in the configuration file using the following syntax:

-Q printername[;option1=x][;option2=x][;option3=x]...

The following options may appear in any order. Options not supported by the printer driver are ignored. printername should appear as shown in WINPRINT-NAME, but the options are case insensitive.

Note: The options PITCH, COLS, LINES, and FONT are all mutually dependent. Omitting one or more of these options may cause the resulting printout to look wrong.
%%ACU-CURRENT%% May be set immediately after the -Q instead of providing a printer name. This specifies to use whatever printer is currently considered the runtime's default printer.
Note: This entry is case sensitive, it must be all upper case.
%%WINDOWS-STANDARD%% May be set immediately after the -Q instead of providing a printer name. This specifies to use whatever printer is currently considered the Windows default printer.
Note: This entry is case sensitive, it must be all upper case.
CHARSET Specifies one of the character sets defined in fonts.def. Refer to the supported values described in the table below. If you use CHARSET, you must also use FONT.

If CHARSET is not specified, it has the same effect as CHARSET=WIN-DEFAULT. To specify an alternative character set, the necessary fonts must be present on the computer.

COLLATE Specifies that multiple print copies should be collated. In order for COLLATE to have any effect, COPY must also be set to a value greater than 1. COLLATE takes the following values:
  • 0, NO, FALSE

    Implies no collating, or collating off.

  • 1, YES, TRUE

    Specifies collating, or collating on.

COLOR Indicates to print in color. COLOR may be set to a legal RGB color code number. See the library function WINPRINT-SET-TEXT-COLOR for more information on the color value.
COLS Specifies the number of columns (width) on the page. This number is not validated by the runtime or the spooler. Choose a number of columns that coordinate with the selected font and pitch when designing the report layout.
COPY If your printer supports this feature, COPY allows you to specify the number of copies to print.
DIRECT Setting DIRECT to ON causes the job to print as if the configuration file was set to -P SPOOLER-DIRECT. This option also disables any use of additional options. Setting DIRECT to the default of OFF causes the job to print to the selected printer as if the configuration file was set to -P SPOOLER.
DUPLEX If supported by the printer, enables printing on both sides of the paper. If not supported by the printer, single-sided printing occurs without any warning.

DUPLEX takes the following values:

  • 1, NO, FALSE

    Default value, which implies no duplex.

  • 2, YES, TRUE

    Implies vertical duplexing.

  • 3

    Implies horizontal duplexing.

FONT Use FONT to specify a single font name. The font name may have embedded spaces, but may not contain double or single quotes. If the font does not exist, the closest matching font is chosen.

The runtime does not align columns. If you are printing a report containing columns, you should use a fixed-width font.

LINES Specifies the lines (rows of characters) on the page. This number is not validated by the runtime or the spooler. Choose a number of lines that is compatible with the selected font and pitch when designing the report layout.
ORIENTATION If your printer supports this feature, ORIENTATION allows you to specify LANDSCAPE or PORTRAIT orientation for the report. The default value of ORIENTATION is driver specific.
PAPER Specifies the paper size to be used for the print job. PAPER is set to a paper format number for the target printer and the target tray. See library function WINPRINT-GET-PRINTER-MEDIA for more information on paper formats. Paper formats and paper trays are individual and unique to each printer installation. They can also be modified by users. Because of this, you should use a calibration routine when installing your software. This is a program that will list the available printers, paper formats, and trays. The output from the calibration program can then be used to assign the PAPER and PAPERTRAY properties. A sample calibration program called PaperInfo.cbl is provided in the samples directory of ACUCOBOL-GT. The output from this program appears in the Example section and is used to demonstrate the setting of PAPER and PAPERTRAY.
PAPERTRAY Specifies the paper size to be used for the print job. PAPER is set to a paper format number for the target printer and the target tray. See library function WINPRINT-GET-PRINTER-MEDIA for more information on paper formats.

See the important note for the PAPER variable.

Also note that if there is no match between the paper format designated to a tray in Windows and the value you set in PAPER, the paper choice will take precedence and the printer driver will choose the tray that supports your paper choice.

PITCH This value specifies the point size of the font. Pitch does not determine the number of characters per line. If you use a larger pitch, the characters simply appear more crowded. For example, when you are printing 132 columns, a pitch of 10 produces better character spacing than a pitch of 12.
SPOOLER-RESET Resets the printer to its start up defaults. SPOOLER-RESET takes the following values:
  • 0, NO, FALSE

    No change.

  • 1, YES, TRUE

    Reset printer to start up defaults.

CHARSET Values

CHARSET can take one of the following values:

Variant 1 Variant 2 Variant 3
DEFAULT WFCHARSET-DEFAULT 1
WIN-OEM WFCHARSET-WIN-OEM 2
WIN-SYMBOL WFCHARSET-WIN-SYMBOL 3
WIN-SHIFTJIS WFCHARSET-WIN-SHIFTJIS 4
WIN-HANGUL WFCHARSET-WIN-HANGUL 5
WIN-GB2312 WFCHARSET-WIN-GB2312 6
WIN-CHINESEBIG5 WFCHARSET-WIN-CHINESEBIG5 7
WIN-JOHAB WFCHARSET-WIN-JOHAB 8
WIN-HEBREW WFCHARSET-WIN-HEBREW 9
WIN-ARABIC WFCHARSET-WIN-ARABIC 10
WIN-GREEK WFCHARSET-WIN-GREEK 11
WIN-TURKISH WFCHARSET-WIN-TURKISH 12
WIN-VIETNAMESE WFCHARSET-WIN-VIETNAMESE 13
WIN-THAI WFCHARSET-WIN-THAI 14
WIN-EASTEUROPE WFCHARSET-WIN-EASTEUROPE 15
WIN-RUSSIAN WFCHARSET-WIN-RUSSIAN 16
WIN-MAC WFCHARSET-WIN-MAC 17
WIN-BALTIC WFCHARSET-WIN-BALTIC 18

Examples

To use the Windows spooler with an HP Laserjet printer driver located on SERVER1, and specify the font, font size, width and number of lines in the report, enter the following into CBLCONFI:

PRINTER1 -Q \\SERVER1\HP Laserjet IV;FONT=Times New Roman;PITCH=12;COLS=132;LINES=65.

To print three copies directly to the printer on a server named GUTENBERG in Landscape orientation, enter the following into CBLCONFI:

PRINTER1 -Q \\GUTENBERG\HP Laserjet IV;DIRECT=ON;ORIENTATION=LANDSCAPE;COPY=3

To specify the Greek character set on a server named SERVER5, enter the following into CBLCONFI:

PRINTER1 -Q \\SERVER5\Laserjet;FONT=Courier New;PITCH=12;LINES=60;COLS=80;CHARSET=11