I have a problem.
An old DOS application (running on Win XP, 32 bit) can print to LPT1-3 or one of several COM ports.
With a Net Use command I have managed to redirect printouts to the attached USB printer from Samsung.
Unfortunately, the printer ignores the PCL sequences from the DOS app. in order to switch between 96 and 132 characters pr. line.
The Esc. char. is printed as a rectangle and the rest in the sequence as is, making the printout rather confusing.
Now, I had this idea:
Could I write an application, that sort of captures the, say, LPT3 port,
interprets the Esc sequences and prepares a canvas for printing in a 'normal' Windows way?
Creating a printer on LPT3 seems easy enough. Even though the printer or the port physically don't exist.
But how do I redirect the LPT (or COM) port/pipeline to something within my app?
Starting the DOS app. is done with a .BAT file that also runs that Net Use command. (and terminates it after use). Thus a perfect place from which to start my capturing app.
Terminating the app again may require some messaging or other, but that is small, I guess.
As the user of the PC in question is well above 80 and has a IT-literacy only slightly above what you could expect from somebody who barely can tell the difference between DOS and XP, this printing must be completely transparent. Switching out into Windows in order to specify file printing or similar is a definite NO-NO!
An old DOS application (running on Win XP, 32 bit) can print to LPT1-3 or one of several COM ports.
With a Net Use command I have managed to redirect printouts to the attached USB printer from Samsung.
Unfortunately, the printer ignores the PCL sequences from the DOS app. in order to switch between 96 and 132 characters pr. line.
The Esc. char. is printed as a rectangle and the rest in the sequence as is, making the printout rather confusing.
Now, I had this idea:
Could I write an application, that sort of captures the, say, LPT3 port,
interprets the Esc sequences and prepares a canvas for printing in a 'normal' Windows way?
Creating a printer on LPT3 seems easy enough. Even though the printer or the port physically don't exist.
But how do I redirect the LPT (or COM) port/pipeline to something within my app?
Starting the DOS app. is done with a .BAT file that also runs that Net Use command. (and terminates it after use). Thus a perfect place from which to start my capturing app.
Terminating the app again may require some messaging or other, but that is small, I guess.
As the user of the PC in question is well above 80 and has a IT-literacy only slightly above what you could expect from somebody who barely can tell the difference between DOS and XP, this printing must be completely transparent. Switching out into Windows in order to specify file printing or similar is a definite NO-NO!