First post, by qv90
- Rank
- Newbie
If you ever used DosBox 0.65 and tried a program like "Framework IV" you'll have noticed, there is no printer support available.
For all DOS programs which want to access printer by device name, I've written this patch. All output to LPT1-4 is captured into files named "devLPTx.prn" (x-device 1-4) in the DosBox directory. If print is terminated (DOS program closes the device) a system command (as defined in dosbox.conf) is executed to deliver output to host printing system. All output from the issued command is echoed to the dosbox console. At termination of DosBox, the temporary "device" files were automatically deleted.
To get it to work, please
1. Apply patch by switching to DosBox source directory and enter "patch -p0 < PrtDev.diff".
2. Compile the new version ("./configure && make")
3. Call dosbox.exe
4. Enter "config -writeconf dosbox.conf"
5. Load dosbox.conf into editor
6. Search for "[printer]" section
7. Print output is discarded by default:
...
LPT1=disable
...
8. Change "disable" to a command which sends output file to your host printing system. If you're working on a Windows system, you may use "copy devLPT1.prn LPT1 >Nul".
Remarks:
- The ">Nul" parameter is used to minimize output to DosBox console (error message will still be shown on DosBox console window). Check out as required. For debugging purposes you may discard that parameter.
- You may use more complex commands. If the DOS program generated PostScript output and you've only a PCL printer, then you can convert the print output by sending print file to GhostScript (which is able to convert output from PostScript to PCL) and then send it to your printer.
- You can easily redirect output from one printer device to a diffrent host system printer device by modifying the output command (e.g. "copy devLPT2.prn LPT1 >Nul").
ToDo:
- I noticed that some DOS programs open and closes the device after only a couple of bytes. The output command is then executed each time the device is closed, resulting in a heavy slow down during printing. I'm currently working on a solution which does some sort of "spooling". There will be an additional parameter "timeout=" where you can specify a delay before the collected output is delivered to host printer. Stay tuned 😀
- Printer interupt were not captured.