Note: The copyright is owned by the original author (Leaf. Duan). Please refer to the famous source for reprinting. Thank you!
Device information
Epson TM-T88IV Thermal Printer, Epson TM-T88IV Thermal Printer, mainly used to print the receipt)
Operating System: windows 7 Ultimate x64
Environment Configuration
To use Microsoft Point of Service for. NET for Epson devices, download the following two installation packages and make the appropriate Configuration:
1. download Microsoft Point of Service for. NET v1.12
PS: We found that the latest version v1.14 is not supported by EPSON and the device cannot be found using this API.
2. Download epson opos adk for. NET
First install Microsoft and then Epson. After installing these two things, we need to use Epson's SetupPOS to map a Logical Name to the physical device Printer for program use.
I am using the Wire Network method, so you need to set the Printer IP Address, you can refer to How to Setting EPSON TM-T88IV Printer IP Address
Print
The next step should be the actual practice stage. How to print code operations? This is one of my encapsulated PosPrinter. cs code on Github. You do not need to explain the specific usage.
* Receiptemplate *
Print content templates. In this case, network information is scarce. For example, you need to print the following content:
Leaf. Duan
0001
* Pay attention to the call number.
22:53:18 18-June-2014
There are basic format controls such as font thickening, resizing, stretching, and text center alignment, as well as Feed control and Cut Paper settings for Paper spacing adjustment. For details, refer to Microsoft API, to give a Template as shown in the following figure:
1/* 2 ESC | cAESC | 4C {1} {0} {0} {0} ESC | bCESC | 5hCESC | 5vC {2} {0} ESC | NESC | cAESC | 4C {0} {0} {3} {0} {0} {0} ESC | NESC | cA {4} {0} ESC | 5lFESC | 100 P 3 **/ 4 5 ESC | cA // text Center 6 ESC | 4C // double position size (double width) 7 Leaf. duan // {1} 8 {0} 9 {0} 10 {0} 11 ESC | bC // font bold 12 ESC | 5hC // horizontal stretch 5 times 13 ESC | 5vC // vertically stretch 5 times 14 0001 // {2} 15 {0} 16 ESC | N // The setting returns to normal, 17 ESC | cA // text center 18 ESC | 4C // text size doubled 19 {0} 20 {0} 21 * Note the call no. // {3} 22 {0} 23 {0} 24 {0} 25 ESC | N // The setting returns to normal, 26 ESC | cA // text center 27 22:55:18 18-June-2014 // {4} 28 {0} 29 ESC | 5lF // Feed 5 lines 30 ESC | 100 P // Cut Paper 100%, it is 100% paper-cutting. The specific proportion can be set to 31 32/* or above {0} as needed to represent the line feed Environment. newLine; ESC can be replaced by \ x1B, but note the escape. ESC can also be replaced by (char) 27 ). toString () For Replace */
Question
How to Use the EPSON printer driver API, suchStatusAPIPrint? Because the official EPSON documentation is confusing and not conducive to developers, I have not studied it. Do you have any idea whether this implementation method can be shared with you.
Summary
Because the information about this is fragmented on the network, this article is to be sorted out. Due to the rush of time, the depth of exploration is limited, and we hope you can share your experiences.
PS: It is very convenient to download the software EpsonNet Config to view how to discover EPSON devices in the same network.