Hardware: EPSON TMH6000M
Software: epson opos adk 2.5
Microsoft POS for. net 1.12
Step 1.
Epson opos adk 2.5 is a collection of pos printer drivers. After installation, the pos printer is connected,
There is a setup pos tool in the Start Menu. Add the pos printer and select the appropriate port. After the installation is complete, a LogicalName should be set for the pos printer for the program to use.
Step 2
Install Microsoft POS for. net 1.12, Which is Microsoft's encapsulation layer for POS devices. It can be recognized and used by devices that comply with international standards.
Step 3
. Net code references Microsoft. PointOfService
Sample Code:
If you want to print Chinese (simplified/traditional), please note that the CharacterSetList of Printer does not contain 936,950,
In addition, pay attention to whether the non-unicode settings set by the window domain are consistent. For example, if you want to make a traditional one, you must set it to China Hong Kong (950)
Code
1 // Use a Logical Device Name which has been set on the SetupPOS.
2 string strLogicalName = "PosPrinter ";
3
4 // Create PosExplorer
5 PosExplorer posExplorer = new PosExplorer ();
6
7 DeviceInfo deviceInfo = null;
8
9 try
10 {
11 deviceInfo = posExplorer. GetDevice (DeviceType. PosPrinter, strLogicalName );
12
13 m_Printer = (PosPrinter) posExplorer. CreateInstance (deviceInfo );
14 // Open the device
15 m_Printer.Open ();
16
17 // Get the exclusive control right for the opened device.
18 // Then the device is disable from other application.
19 m_Printer.Claim (1000 );
20
21 // Enable the device.
22 m_Printer.DeviceEnabled = true;
23
24 m_Printer.PrintNormal (PrinterStation. receept, "Hello World! \ N ");
25
26}
27 catch (Exception)
28 {
29
30}
31
32