Printers in Classify

Table of contents


Working with printers in Classify consists of two main area's. First of all, there is the programming angle. Second there is the setup side. Programming can roughly be devided in "using standard batch classes" and "not using the standard batch classes".

In this document we try to outline all three the aspects of the printing highlighting the main messages as well as the set up of a printer environment.


Printing outside the batches

All printer actions in Classify are now handled inside the IO-Manager, which is a part of the desktop. To make use of the device & printer handling of Classify, you must use the pOpen_Device message to request a channel. This message takes a single argument: the address of an array object containing preferences for the device.

This array has the following structure:


Row Name Description Values
0 Device ID The ID of a default device Specified device or blank
1 Prompt mode Should the user be prompted for a device One of the following:
2 Protect Redirect Disallow redirection if true True|False
3 Print command string Additional string that will be passed to the command line when using "Print thorugh file". The position where this will be inserted into the print command should be marked by $2$ in the print command in the device specification. Anything; for instance the name of a WordPerfect macro when you "print to" a WP file.
4 Paper width Required paper width positive integer
5 Paper type The required paper type (empty for no selection) Any specified type
6 Double sided Does the printjob require double sided printing? "Y" or blank

Once the device is opened and you have obtained the channel number, you can retrieve the following settings per channel:

Property units
pPage_length Lines (based on current pitch/orientation)
pPage_Width Characters (based on current pitch/orientation)
pPage_Slack Lines (based on current pitch/orientation)
pPage_Top_Margin Lines (based on current pitch/orientation)
pPage_Bottom_Margin Lines (based on current pitch/orientation)
pPage_Left_Margin Characters (based on current pitch/orientation)
pPage_Right_Margin Characters (based on current pitch/orientation)
pPage_Orientation "P" or "L"
pPage_Horizontal_Pitch Characters per inch (number)
pPage_Vertical_Pitch Lines per inch (number)
pLine_Count Number of lines printed on current page
pFree_Lines Number of lines available on current page
pPage_Count Current page number

To print information, you can use the following messages:

Message Arguments Description
mWrite Channel_Number
Write the specified string to the specified channel
mWriteln Channel_Number
Write the specified string to the specified channel and perform a linefeed
mWrite_Image Channel_Number
Image number
Number of lines
Write the specified image to the specified channel
mWrite_Image_Wrap Channel_Number
Number of lines
Write the specified image to the specified channel using wrapping
mWrite_Printer_Code Channel_Number
Retrieve the printer command string for the printer associated with the specified channel and output that code.
This can change number of available lines and such!
mForce_Free_Lines Channel_Number
Check whether the specified number of lines is available on the current page and if not, generate a new page
This message is excecuted automatically by all mWrite_* messages as well.
pCheck_Free_Lines Channel_Number
Check whether the specified number of lines is available on the current page and if not and return 0 if so, 1 if not enough, -1 if the number of lines exceeds page length
mPage_Feed Channel_Number Perform a formfeed


Printer configuration

You can configure printers per installation. There are several files in which you can record information specific for your installation.


Printer types

This file contains information on the types of printers your application supports. In this file you specify the following informtion:

For printer (de)initialisation, we suggest you used indirect codes, such as >#INIT< (see below).


Printer control codes

Per printer, you can specify printer control codes. The mnemonics for the printer codes are specified in the normal table "HDS20008". The actual control string are specified in the printers view.

In the control string, you can use <XXX> to specify decimal values for control characters (e.g. <27> for "Escape"). You can also specify <#AAA> to specify other control codes. For instance, you could specify "INIT" as "<#RESET><#LANDSCAPE>".

We recommend that you specify both "logical" codes and "physical" codes. Examples of "physical" codes would be "condensed", "10 cpi" or "bold". The "logical" codes would be "133 columns", "letter quality" and so forth. The logical codes will achieve a given result, using the appropiate physical codes for a given printer. For instance, the code "133 columns" could be empty on a wide matrix printer, condensed on a standard matrix and 16cpi on a laser printer.



The devices are installation specific. A device can be a physical port, but it can also be a print queue or a program you want to initiate (e.g. a text editor or a file browser). You can tell Classify to print direct, or to create a temporary file first and than process that file. You can tell Classify to execute commands prior to the print and after the print has completed.

A device is associated with a printer type and with paper types available in the attached printer. The paper types themselves are specified in the normal table "HDS2007". In this normal table, you can also specify the size of the paper. When you specify papertypes per device, you can also specify a printer code to select the appropiate paper tray.

You need to specify at least the paper type "DEFAULT" in the normal table. The dimensions for this paper will be used whenever no paper is specified for a printer. If you do not specify this paper type, page length 0 will be assumed!


User access rights

You can grant access per user to specific devices. This way, you can configure specific devices for specific users, preventing a user to print on a device on the other end of the building, or in a different office!. Here, you can also specify a "prefered" device per user.

If you do not want to go through the effort of specifying devices per user, you can set the print security in the system configuration section of the cl_main.ini file to off, in which case we will skip the check for the user attachment.

Selection an output destination

When the user is prompted for an output location, he will be offered only those devices that:




© Copyright 1995, 1996, Calvin Consultancy