0

I've got this old Windows program that prints by writing directly to an LPT port. Unfortunately, the number of printers we can get that are compatible with it keep dwindling. The obvious choice to just ditch the program and move on to something more modern isn't available right now. I don't have access to the source code, so modifying the program isn't on the table either.

What I'd like to do is write a program that creates a fake LPT port, reads and interprets the data sent by the old software to that port, and then prints using the actual Windows print spooler. I already know how to print, and I'm pretty sure I can decode the raw data I get, so all I need is help creating the virtual parallel port.

I'm using C++ for this, because that's what I have available right now.

  • https://superuser.com/q/182655/52365? – GSerg Jun 28 '23 at 17:27
  • @GSerg That's not the same thing. That's about redirecting a parallel printer to a USB one. I want to just capture the data and process it myself, because modern printers *don't understand* the old program. – HiddenWindshield Jun 28 '23 at 17:32
  • 1
    Search the internet for "Windows driver printer". You want to write a driver that replaces LPT port. – Thomas Matthews Jun 28 '23 at 18:05
  • @ThomasMatthews Searching the internet for "Windows driver printer" just resulted in a bunch of "how to download and install printer drivers" pages. I did google "writing your own printer driver", but *those* pages all assumed that the port already exists, and you just need to open it to send data to the supposed printer. – HiddenWindshield Jun 28 '23 at 18:40
  • MS doesn't really support your writing a driver for parallel port hardware. https://learn.microsoft.com/en-us/windows-hardware/drivers/parports/device-stacks-for-parallel-ports-and-devices (note in the figure that all the hardware parts are shaded dark grey, indicating they're supplied by MS). One possibility would be to run your program inside something like VirtualBox. Create an LPT port in the guest, with the output connected to a file on the host. Then you can process that data as you see fit. – Jerry Coffin Jun 28 '23 at 18:46
  • So, get a book on writing Windows Device (printer) drivers. There are a bunch. Mine is archived in the garage somewhere, so I can't tell you name and author. :-( – Thomas Matthews Jun 28 '23 at 21:53
  • 1
    Are you looking for something like [Printfil](https://www.printfil.com/manualen/c7.htm), an utility that allows you to capture LPT data to a file? – heap underrun Jun 29 '23 at 03:03
  • @heapunderrun Yes, that's sort of what I'm looking for. I guess I could have my program monitor the output directory of that program. – HiddenWindshield Jun 29 '23 at 17:47

0 Answers0