mtmsuhail / ESC-POS-USB-NET

This project is a simple .NET (C#) Implementation of the Epson ESC/POS Printing using USB Device Driver.
MIT License
202 stars 86 forks source link

Can you update the code for .Net Maui (Android)? #58

Open datadumped opened 1 year ago

datadumped commented 1 year ago

I added this package to a .Net Maui project and it works great when I run it on a Windows device emulator. When I try to run it on an Android emulator (Samsung Tablet) I get an error. The tablet is paired to my Star TSP100 POS Printer. Like I said, it works fine and prints on the same printer when I run it as a windows device. I need to get this to print from an Android tablet for a POS system I'm planning on building.

System.DllNotFoundException: 'winspool.Drv'

Any help would be greatly appreciated. Thanks!

datadumped commented 1 year ago

I was able to print in .Net Maui. private void btnPrint_Clicked(object sender, EventArgs e) { Printer printer = new Printer("TSP100-1"); System.Text.EncodingProvider ppp = System.Text.CodePagesEncodingProvider.Instance; Encoding.RegisterProvider(ppp);

        printer.TestPrinter();
        printer.FullPaperCut();
        printer.PrintDocument();
    }
andylim-mkj commented 11 months ago

@datadumped I tried your code, still giving 'winspool.Drv' error from Android. Can someone pls help?