Recently I implemented a project which uses mobile thermal printer. What I perceived is that nowadays a lot of mobile applications are implemented using Windows Mobile to help run business operations like route sales, and even for gambling purposes.
For all the mobile printer that I came across, e.g. from Extech, Datecs or Sprint., some provide very good documentation, printer drivers and utilities which make it very easy to print.
Unfortunately, in my project the printer does not come with the necessary printer SDK for Windows Mobile. As such, I have to write a DLL in Visual C++, and called from VB.NET. After digging through the documentation, I came out with a simple library which is enough for my own use.
Below I showed you some of the SDK APIs I implemented. You can download the source code and modify to suite your need.
This API uses CreateFile, SetCommTimeouts, SetCommState, SetupComm to create the bluetooth connection. Take note that for COM port lower than 10, you can use “COMx” but for COM port greater than 10, it uses \\.\COMx.
PortClose just closes the bluetooth connection using CloseHandle.
SetFont uses WriteFile to send the necessary commands specific to the printer to set the fonts. You may need to change this part.
PrintText uses WriteFile to send the text printing commands to the printer.
ReadData uses ReadFile to read data from the printer.
There are some other APIs like PrintImage and PrintBarCode that I implemeneted. It is important that you understand the commands the printer uses. You should read the documentation from the printer manufacturer.
Good luck programming !