Sticker: POS printer Programming Control

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.