DOS Printing and Modern Printers.: SEL Sel "Printer Name"
DOS Printing and Modern Printers.: SEL Sel "Printer Name"
DOS Printing and Modern Printers.: SEL Sel "Printer Name"
Enabling DOS applications to print to modern (Windows) printers isnt that straightforward:
In the DOS days, printers were connected to a parallel (LPT1-3) or serial (COM1-4) port. Printers now
connect to an USB port, or even wireless.
DOS applications can only print to a parallel or serial port; they dont know about future USB ports.
Modern PCs dont have parallel or serial ports anymore.
DOS printers expect to receive text. A DOS application adds printer control codes to end a line (line
feed), eject a page (form feed), eventually print in bold (DOS printer model specific codes) When a
line ended, it was immediately printed (dot-matrix printers). Modern (Windows GUI) printers mostly dont
support text input and are not line orientated. Instead they expect graphical images of complete pages.
DOS text is ASCII based; 128 (minus 32 control codes) characters, basically those found on an US
International keyboard. ASCII was extended to support an additional 128 characters. Due to ASCIIs
limitations, a language specific DOS code page is needed to define what those extra characters
translate to in Windows text (Unicode with thousands of characters).
Some work is needed to facilitate a DOS application to print to a Windows printer, mainly:
The stream of text and printer control codes sent to a LPTx/COMx port has to be collected, and at some
moment converted to graphical images of pages.
Those images then have to be redirected to a Windows printer (mostly not parallel/serial).
Printing in vDos.
If you dont tell vDos (in config.txt) what to do with text sent to a LPTx/COMx port, vDos will print to the
default Windows printer. If the printer output is plain text (with line feeds and eventually form feeds),
possibly with printer codes inserted by your DOS application as if it was printing to an Epson/IBM
compatible printer, this should work just fine.
You can adjust the default settings of how this text is handled by adding a LPTx/COMx = options line
(without the quotation marks shown here) to config.txt. The options on the right side of the equals sign are:
SEL
Will first display a printer selection dialog; choose to what installed Windows printer to print.
SEL=printer name
Explicitly set the printer to be used.
* Default: the default Windows printer
RAW
To use this option, the (selected) printer must support DOS text input (PCL/PostScript printers do). The
(ASCII) text is sent directly to the printer. For example, use RAW when printing to an actual PCL printer,
after choosing a PCL (mostly HP) printer in your DOS application.
HORZ=left[,right,chars]
left: The left paper margin in mms.
right: The right margin in mms.
chars: The number of characters that have to fit between these margins.
* Default: 15,10,80
VERT=top[,bottom,lines]
top: The top paper margin in mms.
bottom: The bottom margin in mms.
lines: The number of lines that have to fit between these margins.
* Default: 10,15,calculated using the paper size.
Example:
LPT1 = sel horz=15,10,132
Displays a dialog to select the Windows printer to use, then prints in a smaller sized default Courier New
font, so 132 characters will fit between the left and right margins.
DOSPRN
Shareware ($14.95, price drops at more licenses).
DOSPRNs author added some extensions to make it work better in vDos. DOSPRN also supports IBM
and PCL codes, and you can eventually define alternative sets of printer codes.
Usage example LPT1: LPT1 = "%ProgramFiles%\DOSPRN\DOSprn.exe" options #lpt1.asc
DOSPrinter
Shareware, it comes in two distinct versions, with a reduced price for vDos users:
Standard ($ 30,-, price drops at more copies).
Single user/workstation license.
Unlimited ($ 380.-).
Grants you the right to use DOSPrinter on an unlimited number of PCs inside your company, you can
also distribute DOSPrinter as part of your software package to other companies (royalty free).
Usage example LPT2: LPT2 = "C:\vDos\DOSPrinter.exe" WAIT options #lpt2.asc
(Provided the DOSPrinter program is copied to the default C:\vDos directory).
WinPrint
Freeware ($ 0).
WinPrint installs to the Windows system tray, monitoring a directory for new files to be printed. There
seems to be no documentation on its use or what printer codes are supported.
Usage example COM1: COM1 = dummy
(vDos shouldnt do anything after creating the #LPTx/COMx files, since WinPrint will be set to monitor a
directory for new .asc files, created by vDos).
LPTx/COMx options (x = 1-9, though most DOS programs only support LPT1-3 and COM1-4):
= DUMMY
Dont print; you just want to ignore the printers output, or use an external DOS-to-Windows printer program,
monitoring a directory for new .asc files, created by vDos.
= CLIP
Dont print, copy the (Unicode) text to the Windows clipboard to paste into another program.
Example: COM4 = CLIP
= Windows device:
Communicate with the device interactively (expect no text to collect as a print job). The colon at the end is
required.
Experimental (!) and barely tested; no PC with an actual parallel/serial port, such a device, or even a DOS
program to test around.
Example: COM1 = COM1: