-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Printing support using Windows spooler #223
Comments
I'm super interested in enabling native USB printer through the windows spooler! The only criteria I would have are:
Is this something you'd be interested in contributing? I think it would be really valuable for a lot of people who can't use the virtual COM, it's just not something I was familiar with on how to implement. |
Hmm, I have hacked together something that works perfectly fine for my things, but I haven't put any junctions in that would properly make it fail on Non-Windows. Since I have this just as a local class in my application, I'll just paste it here verbatim for now:
This is basically mostly copied from that other project I mentioned, since it uses the same license we can at least talk with full license compatibility here. All it needs is a Windows printer name and a Windows printer set up to use RAW. Is something like this to your quality requirements? If yes, I could fork the project and commit this file properly with a readme change |
I was researching the same thing. @sinni800 have you foked? Or made some personal implementation for your own? |
I'm definitely interested in getting changes upstreamed in this repo to allow the windows print spooler, as long as it works well and it follows a similar API to the other printers, and properly indicates to the end user if their platform is not supported. Honestly on MacOS and Linux, USB printers usually mount a file under The problem I see in the code above is that it has implementation-specific methods for sending things to the printer. It would make more sense if the printer name / port / etc. were all set up in the constructor, and you just used it like any other printer implementation (construct an instance and then start writing bytes to it). |
They are though, you only need to instantiate WindowsPrinter with a printer Name as the parameter. To print to it, you can use the BasePrinter methods. It could probably be cleaned up a bit, but it already works like that with the current code |
Yeah, i first used it at my project as Elgin I9 printers use this implementation at the sample code guide to C# printing The Class Helper i9 has the base code: Imports System.Text
End Namespace |
Imports System.Text
End Class |
…linux as well) with complete printer status report back. No driver install or Virtual Serial Port needed. Choose printer from list of usb devices and send data straight to the printer like Serial or Network printer. Possible fix for Isuues : lukevp#186 lukevp#220 lukevp#223
I have searched a lot to find a compatible COM port emulation and for me the Epson TM Virtual Port Driver is the only one that works properly for every chinese POS printer. |
As USB printing is currently not possible and some weird china printers don't seem to really have a good way to make a virtual com port (at least I havent found any) I think a good way to make this possible is to have a "Windows Printer Spooler" printer backend.
This project here (same license, MIT) has such an implementation: https://github.com/mtmsuhail/ESC-POS-USB-NET/blob/master/ESC-POS-USB-NET/Helper/RawPrinterHelper.cs
Essentially, creating a RAW printer in Windows and sending ESCPOS to it like you would to a COM port works just fine like that, but this other library is not nearly as good as this one...
The text was updated successfully, but these errors were encountered: