The unofficial Clipper and Windows Printers FAQ

Author: Dick Koster

Last modification date: December 4, 2002 (see revisions for changes)

Introduction and Disclaimer

This page tries to answer the question how a "Windows-only" printer can be used from a Clipper application. I created it when I was looking for a solution myself, and noticed that this topic came up again and again in the newsgroup comp.lang.clipper. It is provided here in the tradition of sharing information across the Internet. However, I am providing it "as is": it is based on my own observations and experiments with various (but not all!) of the solutions described below. I have not done exhaustive testing, so I do not claim that the information given here is accurate and complete. The inclusion of exclusion of a product should not be interpreted as an endorsement (or not); it simply means that I have run across a product at one time or another. Most of the suppliers provide their own information on Internet, and also provide demo copies. Make use of this: the information given here is only intended to be an introduction into the topic, and no more than that. All suggestions for improvement are welcome.

What can you find here:

The Problem

Printer manufacturers are (increasingly?) now making printers which have been designed just for Windows. They assume that most of the intelligence needed for formatting will be provided by the drivers provided for Windows. These printers do not recognize the commands (Escape sequences) which are available in the more "intelligent" printers to do font formatting, line spacing, etc. In some cases, these printers do not even have built in fonts, which means that even the character formatting must be provided by the Windows drivers.

This poses a problem for DOS applications like Clipper, which cannot make use of the Windows drivers, and try to access printers directly.

A related problem is a printer connected via USB: there is no way that a DOS application can access a USB-connected printer directly. See the separate paragraph for comments on this.

The Solution

The best solution is to avoid these types of printers altogether, and to use printers which do support DOS-bases applications. If this is not possible, you will have to resort to add-on products which allow you to channel your printer output to the Windows print system. There are two types of solutions:

Additionally, you can "do-it-yourself" by programming it yourself using Clipper and standard Windows facilities. See here for the details.

Libraries

Libraries contain Clipper callable functions, which you can use directly from your application to send printer output to Windows. The advantage of this approach is that it gives you great control and flexibility over what is printed, and how it should be printed. The disadvantage is that you will need to modify the source, which may be a problem is you have lot's of applications, or if you don't have access to the source. You could of course use such a library to create your own spooler ... (see next paragraph). To my knowledge, there is only one such library available (at least for Clipper).

Spoolers

Spoolers are programs which take standard printer output produced by a DOS application, and forward it to a Windows printer. The advantage of this approach is that it requires no changes to existing applications, and will work with any DOS based application (so not just Clipper). The only requirement is that they must be able to redirect the printer output to disk. They often also can do useful things like auto-fit: i.e. automatically adjust the font size to make the output fit on a page. Sometimes they are clever enough to interpret printer escape sequences, and to adjust the output accordingly. Although I say that existing applications need not be changed, this is not always entirely the case: see remarks for the products below. There is also a limit to what these programs can do: if your application uses fancy escape sequences to get special effects, the spooler may not always be able to handle it.

The Products

Below you will find a brief summary of the capabilities of the following products:

Note that there are numerous other programs. Apparently this is a popular area for Russian developers, as I know of at least two Russian programs (in addition to the ones described here) which can apparently do the job: fprint and dosprn. They both seem to be quite sophisticated, however all information is in the Russian language, so there is nothing that I can tell about them.

Notes on information provided

Below you will find a short description of each of the products. As explained in the introduction, the reader should consult the webpages of the supplier (if available) for a full description. Most of the items will be self-explanatory:

AutoPrint - Reiner Krump
Website www.hrs-krump.de/software/autoprint/autoprint_e.htm AutoPrint watches one or more directories, ands sends incoming files in these directories to an associated Windows printer. The program can process TXT, PRN, and BMP files. Optionally, a starting and termination sequence can be specified for each printer. AutoPrint is free for the occasional user (i.e. if you print less than ten files at a time). 
Current version: 2.05
Type of solution Spooler
Program changes needed No
Autofit No
Graphics Yes
Escape codes No
Preview No
Price USD 40.00 (or free)

 

CPS - Guionardo Furlan
Website www.guiosoft.hpg.com.br/ CPS (Clipper Printer Server) waits for a special file to appear in a directory (hence the need for a program change). It then picks up a PRN file associated with this file, and sends it to the Windows print system. It tries to autofit it, using the length of the first line. CPS comes from Brazil, and is provided with a brief Portuguese README file. Sources (Delphi) can be downloaded also.
CPS was no longer online in November 2002

 

Type of solution Spooler
Program changes needed Yes
Autofit Yes
Graphics No
Escape codes No
Preview No
Price Freeware

 

DOSPRINT - Simply the Best, Inc
Website www.dosprint.com DOSPRINT takes the print file named in the command line, and prints it through the Windows print system. Contrary to some of the other programs, it does not wait for a print file to appear in a certain location. Instead, it must be launched each time a file needs to be printed (hence the need for a program change). DOSPRINT scans the print file for Epson ESC/P and ESC/P2 escape codes, and formats the printer output accordingly. Additional control is provided via command line arguments. A printer previewer is included. There is separate Windows version (DLLPRINT). There used to be a program called WINLINK, a program which helps maintain DOS programs in the foreground while the file is printed; it is unknown if this program is still available.
Type of solution Spooler
Program changes needed To start
Autofit Yes
Graphics Yes
Escape codes Yes
Preview Yes
Price USD 99.00

 

DOSPRINT - EZ Research Lab
Website members.nbci.com/eduardz Yet another DOSPrint, this time apparently a Russian program in the public domain. It takes a printer file name as a command line argument, and must be launched each time a file has to be printed (hence the need for a program change). The output can be influenced by embedding special "$WF" commands in the printer file, for example "$WFOL" sets landscape orientation. It comes with a Readme file in the Russian language, which will not mean much to many users. However the sources are supplied also, and it is relatively simple to figure out how the program works from these.

Note: at in December 2001, it was discovered that this version of DOSPrint had disappeared from this site. Information about it's new whereabouts would be appreciated.

Type of solution Spooler
Program changes needed To start
Autofit No
Graphics Yes
Escape codes No
Preview No
Price Freeware

 

DosWinPrint - Sapient Software
Website www.sapient-software.com DosWinPrint has been designed to print reports with headings and columns, but works on other printouts too. It improves the look of such reports by using proportional fonts, and changing ASCII line graphics into solid lines. The program can create barcodes from numbers. Most of these functions are executed automatically. The way that the program works can be influenced by entering parameters in an INI file. This file contains parameters to adjust margins, select landscape, etc; but also parameters which help the program recognize where columns start. Note that in some cases it may be easier to make small changes to your program to allow better column recognition. Multiple sets of parameters can be entered to handle different types of reports.
Type of solution Spooler
Program changes needed No
Autofit Yes
Graphics Barcodes
Escape codes Yes
Preview Yes
Price USD 24.95

 

Pagescript - AbeeLabs Systems
Website www.abeelabs.com The PageScript library contains a set of functions with which you can print directly from a Clipper application to a Windows printer. Text can be printed in various fonts, sizes, and with effects like bold, italics and colour. Lines and circles can be drawn, and bitmaps can be included in the printouts. Text and graphics can be positioned precisely on the page using co-ordinates. PageScript comes with FinePrint, a print preview and formatting utility in its own right. 
Type of solution Library
Program changes needed Yes
Autofit Programmable
Graphics Yes
Escape codes NA
Preview FinePrint
Price USD 110.00

 

Printfil - Guolo Davide
Website www.guolo.com/printfil/english.htm Printfil looks for a specific file, and prints it according to a number of options which are included in a configuration file. Some of these options are extracted from an additional configuration file, which can be created dynamically by the application. Printouts are automatically sized to fit the page. Printfil can be set up to automatically switch to landscape mode if the length of a line is longer than a certain value. Other possibilities include: print out of multiple copies; inclusion of a graphic file as background; translation of MS/DOS characters to their Windows counterpart; font selection. Optionally, you can also preview the file before it prints.
Type of solution Spooler
Program changes needed Minor
Autofit Yes
Graphics Yes
Escape codes No
Preview Yes
Price Euro 99

 

PrintFile - Peter Lerup
Website www.lerup.com/printfile PrintFile is a utility program that allows you to print plain text files, Postscript and EPS files, and files with embedded escape sequences). Interface is via a standard Windows interface (including drag-and-drop), or via a command line interface. It can be set up to monitor a directory, and to print whatever file is stored there. Special effects can be set up via configuration files: these include font size (via number of characters per line), page heading and footing, translation of MS/DOS special characters to their Windows counterparts, and "N-up" printing (multiple logical pages on one physical page). It also includes a "Pretty printing" feature: this is primarily meant for printouts of program sources, and allows you to highlight specific keywords and comments in another font.
Type of solution Spooler
Program changes needed No
Autofit No
Graphics No
Escape codes Passthru
Preview No
Price Freeware

 

Print Wizard - Rasmussen Software
Website www.anzio.com PrintWiz from Rasmussen Software can process various types of printeroutput: plain text (which it passes on using sophisticated autofit logic to make it fit a page); raw text (with embedded escape sequences or postscript) which is past on directly to the Windows spooler; and Mark up text. The latter is text which contains HTML-like mark-up commands (PWML), with which an application can achieve greater control over what is printed. With the latter, once can specify fonts, fontsize, colour, graphics, barcodes, etc. Obviously you will have to change your program to use these features. PrintWiz also comes with a DLL which can be deployed from Windows-based application environments like Visual Basic. Print Wizard has a number of other features, including the capability to "print" to a fax. Price discounts available.
Type of solution Spooler
Program changes needed No
Autofit Yes
Graphics Yes
Escape codes Passthru
Preview No
Price USD 99.00

 

PRTWIN - Araisa
Website www.araisa.com PRTWIN scans up to nine directories (for nine different Windows printers) for incoming print files, and sends them to the Windows print system. It recognises a number of Epson escape codes, and formats the printer output accordingly. Additionally, it uses a number of proprietary Escape commands to print graphics and to set the printer in landscape mode. It is possible to configure the sequences which are recognised.
Type of solution Spooler
Program changes needed No
Autofit Programmable
Graphics Yes
Escape codes Yes
Preview Yes
Price USD 24.00

 

RPV Printing System - DASP Software
Website http://www.rpvreport.com/ The RPV Printing system can be used to print standard text files (TXT, LST, PRN); for each file type, it is possible to specify the way that the file should be printed (e.g. font, font size,  paper size). Additionally, it is possible to format a report in almost every imaginable way by embedding special commands in the printer output. It is also possible to create a report template in a separate file, which can be combined with variable data that is generated separately. There are various versions available, priced separately.
Type of solution Spooler
Program changes needed No
Autofit No
Graphics Yes
Escape codes No
Preview Yes
Price USD 0 - 29.94

 

WinPrint - Charles E. Kindel Jr
Website www.kindel.com WinPrint is primarily an ASCII file print manager for Windows. It has a commandline interface, so can also be invoked from a DOS program to print a text file. There are command line options to select options like font type and size, and margins. Use can be made of prestored configurations with these options, and additional ones like landscape page format, and the ability to print multiple pages on a single physical page. It recognises formfeed and tab characters (and it is possible to define the amount of space a tab uses).
Type of solution Spooler
Program changes needed To start
Autofit No
Graphics Yes
Escape codes No
Preview No
Price USD 25.00

 

WinPrint - Piero Ronchi
Website www.simtel.net/pub/pd/9929.shtml This WinPrint has to be launched each time to print a file. It takes numerous command line options to select font and fontsize, effects (italic or bold), portrait or landscape, margins, etc. It recognises various line termination conventions (PC, Unix, Macintosh, and even mainframe ASA. Multiple sets of options can be collected in a single parameter file, which presumably makes maintenance easier. WinPrint if free for personal use, and costs USD 50 for business use.
Type of solution Spooler
Program changes needed To start
Autofit Yes
Graphics Yes
Escape codes No
Preview No
Price USD 0 or 50.00

 

WinPrint - Port Ltd, Obninsk, Russia
Website www.port.obninsk.ru/util.htm This WinPrint has to be launched each time to print a file. It takes number of command line options to select fontsize, line spacing, and portrait or landscape. The same effects can be obtained by embedding specific codes in the text (e.g. an escape-c sequence selects condensed font). A small English readme file explaining this is included. There is also a shareware version ($18) with formatting codes and font parameters setup.
Type of solution Spooler
Program changes needed To start
Autofit No
Graphics No
Escape codes No
Preview No
Price Freeware

 

Do it yourself

Besides all the products listed above, you can also take on the technical challenge and do it yourself, using standard facilities available in a Windows system. The general idea is to create a printer file, and then to invoke a Windows program which can then print it for you. There are a number of possibilities.

Notepad

Theoretically, you can invoke Notepad to print a plain ASCII file. Notepad is however a very simple program, with virtually no intelligence of it's own, and there is no way that you can control the printer output. It is not even possible to switch to a next page by embedding formfeed character in the printer file.

HTML

You can create a file with embedded HTML tags, and invoke Internet Explorer or similar to print it out. Reports with columns can be converted to HTML tables in this way, in which case you do not have to worry about column alignment. 

RTF and Wordpad

You can create an RTF (Rich Text Format) document, and use Wordpad to print it. Although RTF seems to be fairly daunting the first time you look at it, in practice it is not all that difficult. RTF offers facilities like selection of font types, sizes, effects, etc. An example was circulated some time ago in comp.lang.clipper.

USB Printers

USB-only printers (i.e. printers that do not have a parallel interface) pose a special problem: they cannot be addressed in any way directly from an MS/DOS environment. All the products listed above will solve this problem for you. 

An alternative solution is described below. It works in Windows/2000 (and presumably /XP, but this has not been verified). It also works on Windows/NT, but as NT does not support a USB port, there is little point of doing this in that operating system :-) .

Apparently this will only work if your PC is connected to a network. If you have a stand-alone PC, you have to set the following registry entry manually to make the above work. Before attempting to do so, you should be aware of the following warning issued by Microsoft:

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

The following information has been taken from. 

http://support.microsoft.com/default.aspx?scid=kb;en-us;239924

Where more information can be found, including side effects. Although the parameter mentioned below seems to imply that it only has an effect if DHCP is used, it should also be set if you have a PC with a fixed IP address.

Use Registry Editor (Regedt32.exe) to view the following key in the registry:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters

Add the following registry value:

Value Name: DisableDHCPMediaSense
Data Type: REG_DWORD -Boolean
Value Data Range: 0, 1 (False, True) Default: 0 (False)

Description: This parameter controls DHCP Media Sense behavior. If you set this value data to 1, DHCP, and even non-DHCP, clients ignore Media Sense events from the interface. By default, Media Sense events trigger the DHCP client to take an action, such as attempting to obtain a lease (when a connect event occurs), or invalidating the interface and routes (when a disconnect event occurs).

Restart your computer.

Any additional information on this topic would be appreciated.

In February 2002, the topic of parallel to USB converter cables was discussed on comp.lang.clipper. The conclusion was that there are cables that convert a USB PC port to a parallel connector that can be plugged into a printer. But no cables that convert a PC parallel port to a USB interface.

Any further input on this subject will be appreciated.

Revisions

December 4, 2002: provided additional information on how to address a USB printer using the \NET USE command.

November 20, 2002: Verified all links, corrected as needed (and if possible). Added RPV Printing System. Added comments on USB-parallel converter cables.

July 10, 2001: noted that CPS was no longer available; corrected statements about USB support and Windows/NT.

June 12, 2001: added Printfil and PrintFile; Verified and corrected links as needed. Various minor corrections.

December 24,2000: added three WinPrints: Kindel, Piero Ronchi, and Port Ltd, Obninsk, Russia

December 22,2000: added DOSPRINT (twice) and PRTWIN; section on Do-it-yourself; information on Preview capabilities; and notes on the information provided for each product.

December 14, 2000: initial version