At the application level DP4 uses the same device architecture and APIs for communicating with both "ordinary" printers and specialised multi-component devices such as Retail or Financial POS equipment controlled via an OSDI. As a result setting up a printer may seem a rather complicated business. Conversely, when setting up a Device Group for an OSDI some of the printer facilities may be irrelevant.
The following is a guide to defining a Device Group in DFSETUP. On this page we will use an HP Laserjet printer as an example. For an example of configuring a Device Group for an OSDI click here.
Before going to the trouble of setting up a new device group you should ask yourself if it is really necessary to do so. In particular, if you are using a 4.6xx release of DP4 and want to print to a regular printer, by far the best way of printing will usually be to print to the DFPRINT print device. This can print to any printer that comes equipped with a Windows Printer Driver. It may also allow you to print to other types of device: for example Windows 2000 comes with a Fax Printer driver, and commercial drivers are available that can do things like creating PDF documents.
Up to release 4.620 printing to DFPRINT always selects Windows' current default printer as the device to print to, although the user can select any other installed printer using a printer set up dialog that is displayed at run time. From release 4.621 you can configure multiple DFPRINT devices each mapped to a different Windows printer. For details see Selecting a Specific Windows Printer for DFPRINT.
From 4.621 it is also possible to configure DFPRINT devices that will convert the output generated DP4 into files that can be read by other applications. For details see Creating Output for Other Applications.
DFPRINT is not available in 4.5xx releases of DP4, but the similar though less powerful utility, WINPRIN, can be used in a similar way.
There are three main dialogs to be completed when setting up a device group for a printer:
In Device Group Description you set up a name for the device, as well as descriptive text that will be displayed when you are prompted to select a device group elsewhere. This dialog also sets important properties such as the destination port to be use for output to the printer. The dialog varies slightly depending on the release of DP4 you are using. Please select the link appropriate to the release of DP4 you are using.
The Boxes and Control Strings dialog allows you to define the characters used to represent DP4 box characters (used by the Table Plan utility for example) and strings for initialising and deinitialising the printer, as described below.
The Additional Attributes dialog allows you to define escape sequences that will be used to when printing 4.5xx coloured text and maps. The use of this dialog is explained below in Changing the Appearance of Printed Text.
In order to print to your printer using the Device Group information you have set up you need to follow the steps described in POD definition to create the device information that DP4 applications use. Typically there will be only one POD for printing to an ordinary printer.
You may wish to send an intialisation string to your printer. For example you may wish to specify a font size or character set. You can specify a short (7 characters max) initialisation string from the Boxes and Control Strings option in the Device Group Editing menu. There is also a similar termination string used when releasing the printer. If you want to specify a longer initialisation string then you have to use COD Parameters. To access the COD parameters for a printer select Component Ouput Devices (CODS) from the Device Group menu, accept the default COD (1), and then choose COD Parameters from the menu that appears. This will take you to a Window of the Device Parameter records. From there follow the instructions for setting up COD parameters as for setting up an OSDI. You will need to have your printer documentation available for details of the escape sequences used by your printer.
In DP4 printer control escape sequences are always terminated by a NUL (binary 0) character, and it is impossible to send such a character to a printer from DP4 directly. Unfortunately a few printers do make use of such characters for selecting some options. The only way to access such options from a DP4 program is via an OSDI.