The SYSGEN configuration utility/Printers
From CometWiki
[PRINTERS]
Minimum Requirements: . This group is not required. . Refer to the minimal INI file to see the minimum requirements to configure Comet.
The PRINTERS group contains information about the configured printers. The following segment title defines each printer:
Printer = printer-name,printer-type,spool-type,spool-name|printer-name, device-name|#[:RAW],driver-event-server-name,owning-node;
Examples:
[PRINTERS]
Printer = LP1,W,N,,//NTServer/HP Laserjet IIP,,;
; Printer-name LP1 ; Printer-type W (Windows printer) ; Spool-type N (non-spooling) ; Spool-name none ; Printer-name //NTServer/HP Laserjet IIP ; DES-name none ; Owning-node none (printer not network sharable)
Printer = LP1,W,N,,HP Laserjet IIP,,;
; Printer-name LP1 ; Printer-type W (Windows printer) ; Spool-type N (non-spooling) ; Spool-name none ; Printer-name HP Laserjet IIP ; DES-name none ; Owning-node none (printer not network sharable)
Printer = LP2,W,N,,Epson MX80:RAW,,;
; Printer-name LP2 ; Printer-type W (Windows printer) ; Spool-type N (non-spooling) ; Spool-name none ; Printer-name Epson MX80 in RAW mode ; DES-name none ; Owning-node none (printer not network sharable)
Printer = LP3,L,N,,LPT1,,;
; Printer-name LP3 ; Printer-type L (local printer) ; Spool-type N (non-spooling) ; Spool-name none ; Printer-name Use parallel port 1 (LPT1) ; DES-name none ; Owning-node none (printer not network sharable)
Printer = LP4,L,A,SP3,*,LPTDRV,SALES;
; Printer-name LP4 ; Printer-type L (local printer) ; Spool-type A (Auto spool) ; Spool-name SP3 ; Printer-name Use default printer port (LPT1) ; DES-name LPTDRV.DLL ; Owning-node SALES
Printer = L99,L,N,,C:\COMET\PRINTER\OUTPUT.TXT,,;
; Printer-name L99 ; Printer-type L (local printer) ; Spool-type N (non-spooling) ; Spool-name none ; Printer-name Text file (C:\COMET\PRINTER\OUTPUT.TXT) ; DES-name none ; Owning-node none
Printer = LPH,H,N,,HTM,HTMLPTR,;
; Printer-name LPH ; Printer-type H (HTML printer) ; Spool-type N (non-spooling) ; Spool-name none ; Printer-name HTM (HTML printer) ; DES-name HTMLPTR ; Owning-node none
Printer = LPT,X,N,,TXT,EXTPTR,;
; Printer-name LPT ; Printer-type X (text printer) ; Spool-type N (non-spooling) ; Spool-name none ; Printer-name TXT (text printer) ; DES-name EXTPTR ; Owning-node none
Segment Title
Printer = printer-name,printer-type,spool-type,spool-name|printer-name, device-name|#[:RAW],driver-event-server-name,owning-node;
printer-name
Required.
The printer device name in the form “Lxx” (where xx can be any alphanumeric character). Printer names must begin with the letter “L”.
printer-type Required.
The type of printer that’s being configured.
Type | Description |
L | Local printer. A printer that is connected directly to the Comet node and assigned one of the following ports: |
W | Windows printer (Windows95 or higher). |
H | HTML printer (Comet2000 Build 291 and higher). See below for more information. |
X | Text printer (Comet2000 Build 291 and higher). See below for more information. |
P | PDF printer (Comet2005 and higher). See below for more information. |
Note: Previous versions of Comet supported remote, network, and fax printers.
These printer types are no longer supported.
spool-type
Required.
Defines the spooling characteristics for the printer that’s being configured.
Type | Description | ||
N | Non-spooling. The system will not create Comet spool files under any circumstances. | ||
E | Exception spooling. The system will create Comet spool files if the printer is off-line or not available. | ||
A | Auto-spooling. The system will create a Comet spool file every time this printer is selected for output. | X | Document Archive (Comet 2005 and higher). The system will create a Comet archive file every time this printer is selected for output. |
spool-name | printer-name
Optional if the printer is non-spooling (N).
Required if the printer is exception (E), auto (A) spooling, or archive (X).
For archives, this parameter takes the form of Dir:Archive. Dir is the CFAM directory where the archive will be created. Archive is the name of the file that will be created to catalog the jobs in the archive. For example:
Printer = LP5,P,X,SPL:INVOICES,pdfFactory,,;
This specifies a pdf printer that creates its archive in INVOICES on SPL.
For legacy configurations, this parameter defines the spool-name or printer-name that will be used if this printer is configured for exception or auto spooling. (If the printer is configured for non-spooling, use a comma and leave this parameter blank.)
Spool-names are in the form “Sxx” (where xx can be any alphanumeric character). . Printer-names are in the form “Lxx” (where xx can be any alphanumeric character).
See below for information about Cascading Printers.
device-name | # [:RAW] Required.
Defines the device-name where output will be sent.
· If this is a local printer, the device name matches the port where the printer is connected (e.g., LPT1, LPT2, COM1, etc.), or use an asterisk (*) to specify the default host printer.
· If this is a Windows printer, enter the printer name such as “HP Laserjet IIP”. Make sure that you use the exact name of the printer as it appears in the Control Panel.
· If this is a printer on a CometAnywhere system, use a pound sign (#) to set the default Windows printer on the remote system. The printing itself is managed by the COSP program on the remote CometAnywhere system.
· If this is a type H printer, enter HTM as the device name.
If this is a type X printer, enter TXT as the device name.
Type H and X printers are available with Comet2000 Build 291 and higher. See below for more information about HTML and text printers.
· To send output to a text file (without launching the text file), use the path name of the file. For example:
C:\COMET\PRINTER\OUTPUT.TXT
In this case, all output that is directed to this printer will be sent to the text file named OUTPUT.TXT in the C:\COMET\PRINTER directory. If this file does not exist, Comet creates it. If the file exists, the output is appended to the end of the file. (Note: Comet does not erase this file.)
To operate the printer in RAW mode, append “:RAW” to the printer name. For example:
HP Laserjet IIP:RAW
See below for information about RAW mode.
driver-event-server-name
Optional.
(Required if a driver event server is being configured.)
Defines the driver event server (DES) program that is to be used with the printer being configured.
If this is a type H or type X printer (available with Comet2000 Build 291 and higher), specify the appropriate DES progr
Printer type | DES program |
H | HTMLPTR |
X | EXTPTR |
See below for more information about DES programs.
owning-node
Optional.
(Required if the printer is to be network sharable.)
Defines the owning node name if the printer is used in a network.
Do not declare this parameter is any of the following is true:
· The printer is not physically attached to a given node . · The printer is declared as auto spool . · You do not have a networked system . · You do not want the printer to be network sharable
"Raw" vs. "Cooked" Mode Printers
Comet offers two modes of printer support for MTB applications. Which mode you use at any given installation depends on the level of compatibility you desire with the DOS version of Comet. The primary difference between a "raw" mode printer and a "cooked" mode printer is the addition of the control word ":RAW" to the Windows printer name for a raw mode printer. A raw mode printer is required for fully 100 percent Comet/DOS compatible printer operation.
The features for each print mode are as follows:
Raw Mode:
Advantages
Disadvantages
· Provides 100% compatibility with existing MTB applications.
· The application may use printer-specific control codes to modify the printer's behavior.
· Requires direct knowledge of specific printer codes by MTB applications to perform special operations (compressed print, etc.).
· The application may not use any Windows-oriented printer controls such as font selection, line drawing etc.
Cooked Mode:
Advantages
Disadvantages
· Provides an MTB application with access to the Windows Graphical Device Interface (GDI), providing enhanced features allowing custom forms to be printed directly under MTB program control.
· Provides limited compatibility for those legacy applications that use standard sized printer forms. Different sized forms may be used if the printer itself has knowledge of the form size when performing a form-feed (note that this is usually NOT the case).
· Printer font type/size may be modified by specifying Windows fonts.
· Knowledge of the specific kind of printer or its control codes is not required by the MTB application to use enhanced features.
· Legacy programs that rely on line counting to print non-standard sized forms may not function properly.
Discussion
Many applications, specifically those that use standard form length (11 inches in the U.S.), can function properly when printing to a cooked mode printer by choosing an appropriate Windows font that is compatible with the printer. To eliminate MTB program modification, "System" fonts can be set to choose a font that will initially be used for a specific printer. System fonts are specified in the COSW.INI file (located in the WINDOWS directory). These settings affect Comet cooked mode printers only. Entries in the COSW.INI file must conform to the following example:
[Printer Fonts] printer name Font-n = font, height, chars per inch, weight
where:
printer name is the name of a Windows printer. If omitted, this entry represents the default for all printers not listed.
n is a number to represent the font. The current standard for font usage is:
0 represents a normal size font
1 represents a compressed or narrow font
2 represents a expanded or wide font
font is the name of an existing Windows font
height is the character height specified in points
chars per inch is the desired number of chars per inch
weight is the heaviness of the font (range=0-1000, normal=400)
Examples:
- for printers not listed separately
Font-0 = Courier New, 12, 10, 400 Font-1 = Courier New, 12, 17, 400 Font-2 = Courier New, 12, 6, 400
- for HP LaserJet 4 only
HP LaserJet 4 Font-0 = Courier, 12, 10, 400
Some printers may not give the desired results with any of the available Windows fonts. If this should be the case, there are two options available:
Configure the Windows printer using the supplied "Generic" printer driver available when setting up your printer. Because generic printers are "text only" printers, Windows will not attempt to load any fonts to the printer, resulting in the printer using whatever font (or other settings) set by the factory or the front panel. Use the raw mode described earlier in this document.
Driver Event Servers (DES)
When using a Comet printer that is configured to operate in "cooked" mode, the printer can be enabled to generate pre-printed pages for an existing MTB application. Specifying a Driver Event Server program in the configuration enables this feature.
A Driver Event Server (DES) is nothing more than an MTB subprogram that is "entered" transparently to the user program. Once in control, the DES program can access the printer and perform various operations to prepare a page for printing by the user application.
As is implied by its name, a DES is entered only in response to certain printer events. Currently those events supported are: Initialization (just after the printer has been opened), NewPage (before a form feed), and Shutdown (just before the printer is closed).
The following example shows how a DES can be included in your Comet .INI configuration file:
Printer = LPW, W, N, , HP LaserJet 4, PWMARK,;
The DES program in this example is named PWMARK.OBJ. Note that the .OBJ extension is not specified in the configuration syntax. Sample DES programs can be found in the Comet demonstration directory for Windows (DMW), which is available, along with the required WDL directory, at the Signature Systems web site.
The following sample DES programs are currently available:
PWMARK (source #PWMARK) draws a water mark on each page PFORM (source #PFORM) generates a sample invoice form PFONT N/C/E (source #PTRFNT) Each selects one of the system fonts as follows: N = System font 0 (normal print) C = System font 1 (compressed [narrow] print) E = System font 2 (expanded [wide] print)
See below for information about the HTMLPTR and EXTPRE driver event servers.
Form feeds and "raw" printers
Here a "workaround" solution to a problem that can happen when you print to "raw" printers under Comet98 and Comet2000. The problem has to do with the suppression of initial form feeds and the assumptions made by some existing MTB applications. Here's some background information.
When you print to a regular (non-raw) printer, there is no form feed problem because Windows ejects a job when it's done, even if your program does not include a final form feed. However, when you print to a "raw" printer, there can be a problem. The WINPRINT.DDL required by all type "W" printers suppresses the initial form feed. For programs that don't include a final form feed, his can cause multiple print jobs to run together (i.e., the second job prints on the final page of the first job, etc.).
Signature Systems solved the problem by writing a small Driver Event Server (DES) program that you can include in the configuration for your raw printers. The DES program is named FFCLOSE.OBJ and it simply issues a form feed every time it detects a non-trivial close of a printer. To configure this option, place the DES program name in the field following the Windows printer name in the configuration .INI file, as shown in this example:
Printer = LP1, W, N, , HP Laserjet 4:RAW, FFCLOSE,;
The FFCLOSE.OBJ program is included in the REL directory starting with release 99.01.
Cascading Printers
Note: Beginning with Comet release .344, cascading printers are no longer required to handle an unavailble printer (E31) configured as type "W", "H", "T", or "P".
Here is a useful method for configuring Windows printers in Comet. The method allows a user to open a printer and, if that printer is not available, have Comet automatically redirect the output to another configured printer. If you configure a number of printers this way, the user's request can "cascade" from one printer to the next until Comet finds an available printer.
The third parameter in the PRINTER= segment title defines the spooling characteristics of the printer. If you choose E (exception) and then attempt to print to a printer that's either busy or unavailable, your job will be redirected to the spooler or printer listed in the fourth parameter.
For example:
Printer = LP1,W,E,LP2,HP LASERJET 4:RAW,,;
If a user gets an open exception on LP1, their job is redirected to LP2.
This type of configuration lets you create a "bank" of printers that can cascade from one to the next if necessary. This is a great way to configure CometAnywhere printers. Let's say you have a single printer configured for your remote users, as follows:
Printer = L10,W,N,,#:RAW,,;
As you can see, the printer named L10 is a non-spooling printer. The # symbol indicates that output will be sent to the remote user's printer.
But, what happens if more than one remote user tries to open L10 at the same time? Because it's a non-spooling printer, the additional users would have a problem.
Here's how to solve that problem. Configure a series of cascading printers beginning with L10:
Printer = L10,W,E,L11,#:RAW,,; Printer = L11,W,E,L12,#:RAW,,; Printer = L12,W,E,L13,#:RAW,,; Printer = L13,W,E,L14,#:RAW,,; Printer = L14,W,E,L15,#:RAW,,; Printer = L15,W,E,L16,#:RAW,,; Printer = L16,W,E,L17,#:RAW,,; Printer = L17,W,E,L18,#:RAW,,; Printer = L18,W,E,L19,#:RAW,,; Printer = L19,W,E,L20,#:RAW,,; Printer = L20,W,N, ,#:RAW,,;
All of the CometAnywhere users could specify L10, and the system would print to the first available printer on the above list. If all CometAnywhere users tried to use L10 at the same time, each user's output would be redirected to the next available printer on the cascade list.
For planning purposes, you should configure the same number of cascading printers as the number of simultaneous CometAnywhere remote users. That way, you won't run out of available printers.
HTML and Text Printers
Starting with Comet2000 Build 291 and REL version 01.04, you can configure HTML and text printers. When an MTB program prints to one of these virtual printers, the output is written to a temporary file in the $(catemp) directory and that file is then launched. If it’s an HTML file, the output is displayed in your default web browser (e.g., Explorer, Navigator). If it’s a text file, the output is displayed in your default text editor (e.g., Notepad).
Notes
HTML and text printers support text output, including the (CR), (LF) and (FF) mnemonics, but do not support the Windows enhanced printing features (e.g., text and font functions, graphics and drawing functions).
When printing to an HTML or text printer from a Comet node, you can print from a foreground or background partition. However, when printing to an HTML or text printer from a CometAnywhere remote system, you can only print from a foreground partition (namely, your own session).
Configuration information
· To configure an HTML printer, specify the printer type as H, the spool-type as N, the device name as HTM, and the DES program as HTMLPTR.
For example, suppose you want to configure an HTML printer named LPH. Here’s the printer configuration command:
Printer = LPH,H,N,,HTM,HTMLPTR,;
· To configure a text printer, specify the printer type as X, the spool-type as N, the device name as TXT, and the DES program as EXTPTR.
For example, suppose you want to configure a text printer named LPT. Here’s the printer configuration command:
Printer = LPT,X,N,,TXT,EXTPTR,;
Implementation Notes
HTML and text printers rely on the interaction between the specified DES program and the Comet2000 printer driver. In order to create a valid HTML document, a minimal number of HTML tags must be added to the output. These additions happen (1) before the user’s program outputs any data, (2) each time the user’s program issues a form feed, and (3) when the user’s program closes the printer. Here are the tags that are added by HTMLPTR driver event server program.
Before the user’s program outputs any data
<HTML>
<HEAD>
<TITLE>
Output from program-name,directory – Comet 2000 version HTMLPTR version
</TITLE>
</HEAD>
<BODY>
Each time the user’s program issues a form feed <HR WIDTH=100%> When the user’s program closes the printer
</BODY>
</HTML>
Important note
If your printed output contains imbedded HTML commands, or characters that are reserved characters in HTML (such as the < and > symbols), these characters are interpreted by the browser the same as all other HTML documents (i.e., the Comet printer driver does not filter imbedded HTML characters). For example, if you print an MTB source program to an HMTL printer, and that source program contains in-line HTML commands (e.g., an eComet source program), the browser will interpret the HTML commands. To avoid this problem when printing Comet output that contains imbedded HTML, use a text printer and the EXTPTR driver event server.
When printing to a text printer, the EXTPTR driver event server adds a line of dashes each time the user’s program issues a form feed. Nothing else is added to the output.
The Comet Utility Source Subset library (XTL directory, starting with version 01.01) contains the source code for HTMLPTR and EXTPTR. If you want to customize your HTML printer output (by adding a background color or image to the <BODY> tag, for example), you can modify and recompile the appropriate DES program.
When an HTML or text printer is closed, the DES program launches the temporary document.
Prior to Comet 2005, each time you print to a type H or type X printer, Comet created a temporary file in the $(catemp) directory. If you want to save one of these temporary files to a more permanent location, you could use the “Save As” feature in your browser or text editor. Beginning in Comet 2005, you may use the (Document = FileName$, Dir$) mnemonic to specify the name and location of the file.
PDF Printers
Beginning with Comet 2005 you can output to a pdf printer. You will need to have a pdf printer driver, either Adobe Acrobat or pdfFactory, installed on your system.
You configure your pdf printer as a type "P" printer:
Printer = LP5,P,N,,pdfFactory,,;
This printer is non-spooling and output will be directed to the pdfFactory printer.
By default, the document will be assigned a name and created in the folder specified in the printer's properties. Optionally, you can assign the document's name and the Comet directory in which it will be created by using the (Document = FileName$, Dir$) mnemonic. When this mnemonic is used, the document is first created in the folder specified in the printer's properties. Then, when the printer is closed, the document is copied to the Comet directory. You may send this mnemonic multiple times to create several uniquely named copies of the document.
Depending on whether you are using pdfFactory or Adobe Acrobat, Comet requires specific printer settings. From the Control Panel, select the printer's properties, then "Printing Preferences". For Adobe Acrobat, be sure the check box for "prompt for pdf filename" is unchecked. If you wish documents to launch automatically when printed, you may check the "view Adobe pdf results" check box. We have also found that checking "Enable advanced printing features" on the "Advanced" tab of the "Properties" dialog speeds up the document generation process considerably. For pdfFactory, be sure the radio button for "save the file in the AutoSave folder" is selected. When using pdfFactory, documents must be launched manually or you may associate the DES program, ViewDoc, with the printer. This will cause the document to launch when the printer is closed.