Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect/capture data for printer from DOS app.

Status
Not open for further replies.

walker2

Programmer
Oct 28, 2006
43
DK
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!
 
Does the Samsung support PCL? If not, go to the PCL forum to get solutions for PCL interpreters.
 
It is very hidden, but as I have been able to trace it, the printer supports SPL, Samsung's own language, which seems to be a page wide image based language.

I have not been able to find anything useful about SPL. Command listing for instance.

But as the DOS app. is line based only, I will need something somewhere in there in the middle in order to convert matrix printer commands to image.
Funny it is though, the previous two lasers did not have this kind of problem. Both worked fine as HP compatibles, even though they were not HP. (Minolta and Brother)
 
An update!
I have tried to make a small app, that simply places 4 lines on a printer canvas and then prints them.
The app works fine with my old HP 930 desk jet, but with this Samsung thing something happens on the way to the que. An access violation error is raised and data never fully reaches the printer spooler, let alone the printer!

This printer is very strange!
Printer name: ML-2165
 
can you eliminate the spooler option for your printer and print directly?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top