SYSPRINT Printing

For BBj-specific information, see Printing in BBj.

Visual PRO/5 can print directly to the printer ports. It is also possible to print to any printing device accessible through the Windows Print Manager.

ALIAS

In order to print through the Windows Print Manager, you must have one or more special ALIAS lines in your config.bbx file, associating a device alias with the pseudo-device SYSPRINT. Some of these are created during installation. Here is a simple example of an ALIAS line for printing with the Windows Print Manager.

ALIAS PD SYSPRINT "Windows Printing System"

Modes

Some special modes apply to the SYSPRINT device.

Mode

Description

MODE="COLS=val" , MODE="ROWS=val"

Set the CP and SP values.

  • If COLS=, ROWS=, and FONT= are specified, then Visual PRO/5 will attempt to find the closest match to all three parameters, without guaranteeing that any of them will match the requested values. Forcing the system to choose the font can cause the interpreter to use slower TrueType fonts, even if a faster device font is available.

  • If COLS= and ROWS= are specified, and FONT= is not, then the number of columns and rows will match the number requested, and Visual PRO/5 will use the best available device font to fit, given the page area available from the driver. For example:

ALIAS LP sysprint "printer" dialog,cols=80,rows=66

If no font can be found to provide the requested number of columns and rows, then an !ERROR=1 is returned on the OPEN.

MODE="DIALOG"

Displays the standard Windows Print dialog. (Ordinarily, the default printer (as selected from the Control Panel) is opened.) Execution of the Visual PRO/5 program is paused until a printer and page setup are selected and confirmed. If the dialog is canceled, the OPEN fails with an !ERROR=13.

MODE="FONT=fontname"

Forces a particular font to be used. The number of available columns and rows is determined by the page size available to the Windows driver. For example, font="Courier" forces the font to be Courier.

MODE="JOBID=name"

Sets the name of the print job as listed in the Print Manager's queue. If it is not used, the default name "Visual PRO/5 Document" is used.

MODE="NOSTATUS"

Turns off the status dialog box for Print Preview.

MODE="PREVIEW"

See Using Print Preview.

MODE="PRINTER"

Allows a specific Windows printer to be opened or preselected in the setup dialog box instead of the Windows default printer. This option can be used in an OPEN verb or in an alias line in config.bbx.

When used in both an OPEN verb and the alias line, the printer specified in the OPEN verb mode string will be used and the one in the alias line will be ignored.

Printers installed locally on the system can be referenced by the printer name, as it appears in the Windows Print Manager.  Visual PRO/5 generates an !ERROR=11 (Missing or duplicate key) if the requested printer does not exist or attempting to access a remote network printer.

Example 1 – Local Printer

ALIAS LP SYSPRINT "" FONT="Courier",PRINTER="Local Printer",COLS=80,ROWS=62

When the above line is placed in config.bbx, it creates an LP alias that defaults to a printer called "Local Printer," instead of the Windows default printer. Note that the quotes around the printer name are necessary because the printer name contains a space.

Example 2

OPEN(1,MODE="printer=PO Printer,setup")"LP"

This example assumes that LP is a SYSPRINT alias. It puts up a print setup dialog box that has "PO Printer" preselected instead of the Windows default printer. Note that when using OPEN, no quotes are necessary even though the printer name contained a space.

NOTE: This option is only available in Revision 2.20 and later.

Example 3 - UNC Printer

Passing a UNC printer name on the OPEN with the PRINTER=mode using just \\server\printer works correctly.

When adding this same printer to the printer alias in the config.bbx, then the \ needs to be escaped. Therefore, the same printer should be referenced as:

\\\\server\\printer

MODE="SETUP"

Displays the standard Windows Print Setup dialog.

As with any other device modes, these modes may be listed on the ALIAS line or used directly in the OPEN statement. The following alias lines demonstrate a few simple variations:

ALIAS PR sysprint "Windows Default Printer"
ALIAS PD sysprint "Print... dialog" dialog
ALIAS PS sysprint "Print Setup... dialog" setup

SYSPRINT 'FONT' Mnemonic

The SYSPRINT device can use a special form of the 'FONT' mnemonic as follows:

Mnemonic

Description

'FONT'
SYSPRINT Font

 

'FONT'(fontname{,cpi,points{,charset}})

Sets the font to be used by the SYSPRINT device. The appropriate font from the font family in the fontname parameter will be used. If the cpi, characters per inch, and points parameters are given, then new print columns and rows will be computed to match the width and height. If the cpi and points parameters are not specified, Visual PRO/5 will attempt to map the font to the current cols and rows selected.

Visual PRO/5 2.x provides the capability to specify a character set via the use of the optional charset parameter (which is the same parameter used by the 'WINFONT' mnemonic.) The following identifies the charset parameter values:

Decimal Value

Character Set

0

ANSI

1

DEFAULT

2

SYMBOL

3

SHIFTJIS

4

HANGEUL

5

GB2312

6

CHINESEBIG5

7

OEM

8

JOHAB

9

HEBREW

10

ARABIC

11

GREEK

12

TURKISH

13

THAI

14

EASTEUROPE

15

RUSSIAN

16

BALTIC

17

MAC

See Also

Print Preview - GUI

Using Print Preview

Printing in BBj

Printing Functionality and Performance