Chapter 7 - How to capture the parallel port's output (PRN:, LPT1:, LPT2: .. LPT9:)
On Unix and Linux systems, redirecting the print output to a file is a very easy task, but on some old DOS or Windows Console Mode applications, the programmer did not give the end user this ability.
In this case you can redirect the LPT output to a file for Printfil, even if a parallel printer is physically connected to that port (for example a Windows-only Laser printer), and even if the parallel port is not physically installed on the PC (on new machines, the parallel ports are no more included nowadays).
Printfil can capture an LPT port by using 4 different tecniques (Mode 0, 1, 2, 3) on NT-based systems (Windows NT, Windows 2000, Windows XP, Windows 2003, Windows Vista, Windows 2008, Windows 7, Windows 8, Windows 2012, Windows 10). On Windows 95/98/ME only Mode 1 is available
In the DOS age you were limited to use 3 parallel ports (max), each one of them could connect a printer (so 3 printers max. could be used on a single PC). With Printfil you no more have such limit, because even by capturing a single LPT port, that data can be forwarded to any Windows printer installed in the Control Panel (so, even if the DOS program prints to LPT1: only, its print jobs can be sent even to 300 or 3000 different printers).
Normally then you no more need to setup the DOS program to print to different LPT ports to manage different printers; just leave it printing to LPT1: (for example) and let Printfil "address" the final printer (for example by enabling the "Choose" option in its own configuration dialog to ask the end user for the destination printer each time a job has been captured, or by the optional CFG file to send the job to a specific printer without user intervention, as described in Chapter 3).
Anyway, Printfil allows even to capture multiple parallel ports simultaneously on the same PC. To do so, you have to run different Printfil copies simultaneously on the PC, as described on Chapter 13, each one used to capture a single LPT port.
How to capture an LPT port in Mode 0
To capture an LPT port in Mode 0 (the default on 32/64 bit Windows systems) you just have to select it in the Configuration -> Standard Printfil's dialog (you can access it by right clicking the Printfil's trayed icon, in the bottom right corner, near the Windows clock)
Printfil will capture all data sent to that port by a DOS or Windows program and will store them in the file specified in the "File to Check" configuration field, than that file will be forwarded to the Windows printer which is choosen in the same configuration dialog.
All this happens automatically. You only have to ensure that the "File to Check" field contains a valid file name. You can leave the default value, or you can setup it as (for example) [e:TEMP]\Printfil.txt, which makes the Printfil.txt file created in the temporary directory (TEMP) of the user who is actually running Printfil.
To capture different parallel ports simultaneously, each Printfil copy running on the PC will have to redirect its own LPT port to a different temporary file (for exemple [e:TEMP]\LPT1.txt and [e:TEMP]\LPT9.txt) to avoid mixing or overwriting different print jobs.
How to capture an LPT port in Mode 1, 2, 3
The instructions below are necessary only on Windows 9x/ME. On the other Windows systems, Mode 0 is the best choice, even if it's possibile to setup the capture as follows however, even in these systems.
In this modes, to capture the LPT output you have to create the "Printfil" virtual printer, as described on the next chapter, then Printfil can automatically capture data sent to the LPT port you choose in its own configuration dialog.
The virtual printer redirects the LPT output to a temporary file on disk, which is also set in the "File to Check" option in the Standard Configuration dialog. This way, after the file has been created by the virtual printer, it's automatically captured by Printfil and sent to the Windows printer choosen in the same configuration dialog.
As each single "Printfil" virtual printer can capture a single LPT port to a single temporary file, to capture different LPT ports simultaneously each single Printfil copy running on the PC will have to use a different virtual printer. Each virtual printer obviously must have a different name, declared in the PFPrinter option (please see Chapter 4)
The 3 different capturing modes works in different ways. Mode 1 can show an error message if the configuration is not correct, but it's much more dependable by Windows then Mode 2 or 3, which uses a direct connection to the "Printfil" virtual printer. Mode 2 and 3 are particularly useful if some Microsoft security hotfixes are installed on your Windows system (for example KB885835), which could block the capture in Mode 1, by showing an error message.
In all the 3 modes however, Printfil uses the Windows networking services to capture the parallel ports. In particular way, File and Printer Sharing for Microsoft Networks must be enabled in your network configuration.
your PC is not networked, then you have to create a Local
LAN connection by installing the Microsoft
Loopback adapter virtual network card (the drivers
are included into your Windows CD-Rom - By the following link you can
access the FAQ page which explains how to install the
Microsoft Loopback Adapter step by step).
This method also solves the Media Sensing problem on the most recent Windows versions. This new Windows feature allows connections to shared printers only when the network is physically connected (to avoid bad cables etc.), but on some situations this could cause problems. For example, even though your network configuration is ok, but your PC is not physically connected (say a laptop), Printfil can't connect to the "Printfil" virtual printer to capture the LPT output.
If you do not want to add the Microsoft Loopback adapter to your network configuration, however you can disable the Media Sensing feature, as described on Microsoft's website: http://support.microsoft.com/default.aspx?scid=kb;en-us;239924