pos-for-.net

Why is the “€” character only printed before printer initialization and not after the initialization?

£可爱£侵袭症+ 提交于 2020-04-18 05:45:48
问题 I have an Epson TM-T88VI printer and use the Microsoft.PointOfService.PosPrinter in C# for printing. Using the following function i get a strange output printed: public static void printerTestFunction2(string printerName) { PosExplorer explorer = new PosExplorer(); DeviceInfo di = explorer.GetDevice("PosPrinter", printerName); PosPrinter printer = (PosPrinter)explorer.CreateInstance(di); printer.Open(); printer.Claim(10000); printer.DeviceEnabled = true; printer.AsyncMode = false; string init

Open Cash Drawer

烂漫一生 提交于 2020-01-06 14:17:17
问题 I need to open Cash Drawer in my WPF application, this is the first time I deal with Cash Drawer, after some search I have knew that I'll use Microsoft Point of Services. So I have installed POSforDotNet V1.14 and start new project and added the reference, I have found this example : CashDrawer myCashDrawer; PosExplorer explorer; public MainWindow() { InitializeComponent(); this.Loaded += MainWindow_Loaded; } void MainWindow_Loaded(object sender, RoutedEventArgs e) { explorer = new

can't claim the PosPrinter

淺唱寂寞╮ 提交于 2019-12-19 21:23:42
问题 I have a TM-T20 Epson, I'm using this code to try to print : "Hello Printer" Message, and i keep tracking of some proprieties of the PosPrinter : public void ImprintHelloPrinter() { //The Explorer PosExplorer explorer = new PosExplorer(); ////Get the device by its type LOGICAL NAME DeviceInfo device = explorer.GetDevice(DeviceType.PosPrinter, "T20PRINTER"); //Create an instance PosPrinter oposPrinter = (PosPrinter)explorer.CreateInstance(device); //Opening MessageBox.Show(@"Statue : " +

The type initializer for 'Microsoft.PointOfService.Management.Explorer' threw an exception. C# printing POS

本秂侑毒 提交于 2019-12-13 07:37:12
问题 private void Form1_Load(object sender, EventArgs e) { PrintReceipt(); } private void PrintReceipt() { PosPrinter printer = GetReceiptPrinter(); try { ConnectToPrinter(printer); PrintReceiptHeader(printer, "ABCDEF Pte. Ltd.", "123 My Street, My City,", "My State, My Country", "012-3456789", DateTime.Now, "ABCDEF"); PrintLineItem(printer, "Item 1", 10, 99.99); PrintLineItem(printer, "Item 2", 101, 0.00); PrintLineItem(printer, "Item 3", 9, 0.1); PrintLineItem(printer, "Item 4", 1000, 1);

POS.NET discovering pos printers

此生再无相见时 提交于 2019-12-11 11:10:56
问题 I use PosExplorer.GetDevices method to look for printers available on network. However, the DeviceInfo object in the DeviceCollection returned by GetDevices() method does not include information on LogicalNames, HardwareId, HardwarePath. In my app, I need to discover available printers and create an instance of those printers. I am using epson t88iv printers. 回答1: Thanks Sean Liming for the reply (http://www.seanliming.com/) POS for .NET can only be used for devices connected locally to the

pos explorer is not finding any device connected to the system in C#

泄露秘密 提交于 2019-12-11 03:54:16
问题 Hi I have installed Star TSP100 Cutter (TSP143) printer driver in my system and tested the printer, Its printing everything. But Now i want to handle the printer through code in c# such as cut paper, Open Printer, Print normal etc.. I have used the below code to instantiate the printer. When i query for the printer it returns null. Any suggestions or help if i am going in wrong way. Thanks public static DeviceCollection GetPrinters() { PosExplorer explorer = new PosExplorer(); return explorer

POS for .Net print formatting - can't use escape character (char)27

隐身守侯 提交于 2019-12-02 17:30:37
问题 I figured out how to print basic text to our POS printer, but I can't figure out how to get the escape characters to work (for bold, text alignment, etc). For now I'm just testing with the Microsoft PosPrinter Simulator. Here's what I'm trying _printer.PrintNormal(PrinterStation.Receipt, (char)27 + "|bC" + printText + (char)13 + (char)10); I'd expect that to print my printText in bold followed by a line break. When I take out (char)27 + "|bC" then it works fine. The documentation for the

POS for .Net print formatting - can't use escape character (char)27

♀尐吖头ヾ 提交于 2019-12-02 10:27:20
I figured out how to print basic text to our POS printer, but I can't figure out how to get the escape characters to work (for bold, text alignment, etc). For now I'm just testing with the Microsoft PosPrinter Simulator. Here's what I'm trying _printer.PrintNormal(PrinterStation.Receipt, (char)27 + "|bC" + printText + (char)13 + (char)10); I'd expect that to print my printText in bold followed by a line break. When I take out (char)27 + "|bC" then it works fine. The documentation for the escape codes is here The error I get is A first chance exception of type 'System.FormatException' occurred

OPOS PosExplorer.GetDevice() returns null when executed in Windows Service

拟墨画扇 提交于 2019-11-30 16:39:48
The code snippet below makes use of OPOS .NET to open a POS printer for printing. It works fine when executed as part of a standalone application. When executed by a Windows Service the call to GetDevice(...) always returns null. explorer = new PosExplorer(); device_info = explorer.GetDevice(DeviceType.PosPrinter, PrinterName); printer = (PosPrinter)explorer.CreateInstance(device_info); printer.Open(); printer.Claim(1000); printer.DeviceEnabled = true; The printer happens to be an Epson TM-U220B. Is there a security issue that needs to be overcome before a service has access to POS devices?

OPOS PosExplorer.GetDevice() returns null when executed in Windows Service

妖精的绣舞 提交于 2019-11-30 16:20:36
问题 The code snippet below makes use of OPOS .NET to open a POS printer for printing. It works fine when executed as part of a standalone application. When executed by a Windows Service the call to GetDevice(...) always returns null. explorer = new PosExplorer(); device_info = explorer.GetDevice(DeviceType.PosPrinter, PrinterName); printer = (PosPrinter)explorer.CreateInstance(device_info); printer.Open(); printer.Claim(1000); printer.DeviceEnabled = true; The printer happens to be an Epson TM