Reputation: 21
There seems to be a method of directly writing and reading data to Windows USB virtual printer port (e.g. USB001) without usage of dedicated printer driver. Anybody an idea how do do that?
Upvotes: 2
Views: 2223
Reputation: 4690
The easiest way is what I put in my original comments. You can create a USB printer using whatever driver you want (gerneric text always works well), then share it out. From here you can connect to the share using something like
net use lpt1 \\your_workstation\printer_share
You can then print to lpt1 (or copy to lpt1) and you will leverage the Windows spooler to get the file there.
The other option is to do this in code sending the data directly to the printer you created (without sharing, assuming its installed on the same system).
How to send raw data to a printer by using Visual C# .NET
You could also send data directly to the USB port but that's a lot of work from my perspective to do something that already is nicely packages in the Windows spooler. Not to mention, you get all the upside of the spooler including, pausing and queueing jobs.
Upvotes: 2