Printer

SDK Upgrade Description

Upgrade Notes

In order to make it easier for developers to call the built-in printer of iMin POS devices, and also to reduce the difficulty of developing printers and simplify app interfacing, we have reconstructed the iMin Print SDK.

Comparison of old and new features

_images/SDK-Difference-contrast.png

SDK V2.0

Connection mode:Bluetooth(Bluetooth device name:BluetoothPrinter), AIDL etc.

Third-party apps can print by connecting to the built-in printer. Features included in iMin printer: 58 and 80mm thermal printer with two printing specifications, cutter (some machines)

Developers can refer to the built-in printer development documentation to understand how the printer works and how the interface is invoked

Built-in printer doc:iMin built-in printer developer document V2.0

1. Access the SDK

The iMin Print SDK is obtained from a remote repository, and you only need to add a dependency in the calling module’s build.gradle

1android {
2    ...
3}
4
5dependencies {
6    implementation 'com.github.iminsoftware:IminPrinterLibrary:V1.0.0.13'
7}

2. Refer to Demo

_images/demo.png

You can refer to SDK to use the source code of Demo for development, click the link below to jump to download the corresponding Demo above

Github address

3. Web print

Demo Case

Desktop POS https://mp.imin.sg/WebPrint/D.html

Moblie POS https://mp.imin.sg/WebPrint/M.html

Note

SDK V2.0 does not require iMinprinterplugin to be installed,Enter the following URL address in the device browser to experience the H5 printing case

4. JavaScript API

Developers can use a JavaScript API to call the built-in printer

Link JS Print SDK

Demo Case

JS Printer demo https://mp.imin.sg/JSPrinter/index.html

JS print development documentation

Note

SDK V2.0 does not require iMinprinterplugin to be installed.

5. Flutter

You can refer to the SDK to use the source code of Demo for development, click the link below to jump to download the corresponding Demo above

Github address

Flutter print development documentation

SDK V1.0

Connection method: Bluetooth (Bluetooth device name: BluetoothPrinter), USB. The third-party APP can print by connecting to the built-in printer. The functions included in the iMin printer: thermal printers with two printing specifications of 58 and 80mm, cutters (some machines), cash drawers (some machines)

The printing function interface of iMin is basically multiplexed, and the model applicable to the document will be slightly different according to the model: D series (D1, D1w, D4), M series (M2, etc.), S series (S1 etc.) Development

The printer is compatible with the ESC & POS command, but it is slightly different from the standard ESC & POS command. Developers can refer to the built-in printer development document to understand the printer’s working mode and interface calling method, and understand the escpos instruction set supported by iMin through the instruction document iMin built-in printer developer document V1.0

1. Refer to Demo

iMin provides printing demo and source code, and supports common printing functions, such as: printing QR code, printing barcode, printing pictures, printing texts in various languages, printing forms, etc. The demo supports both Bluetooth and USB connection methods. Developers need to adapt different SDK files to different iMin devices when developing printing functions.

PS:The demo only supports iMin built-in printers, external Bluetooth serial network USB printers are not suitable for this demo.

2. iMinprinterplugin

iMin provides a printing plug-in support through the native printing function of android. Users can search for iMinprinterplugin through the iMin App Store, and after downloading and installing it, they can print the webpage content through the browser’s printing function.

Demo Case

Desktop POS https://mp.imin.sg/WebPrint/D.html

Moblie POS https://mp.imin.sg/WebPrint/M.html

Note

Enter the following URL address in the device browser to experience the H5 printing case

3. JavaScript API

Users can search for iMinprinterplugin through the iMin App Store, and after downloading and installing it,Developers can use a JavaScript API to call the built-in printer

Link JS Print SDK

Demo Case

JS Printer demo https://mp.imin.sg/JSPrinter/index.html

JS print development documentation

Note

Users can search for iMinprinterplugin through the iMin App Store, and after downloading and installing it.

4. Flutter

You can refer to the SDK to use the source code of Demo for development, click the link below to jump to download the corresponding Demo above

Github address

Flutter print development documentation

SDK release notes

1. SDK V2.0

Version 1.0.0.13

May 17, 2024

first version

Download SDK 1.0.0.13

2. SDK V1.0

Version 1.3.1

09/10/2024

  1. By default, grayscale processing is added to printed pictures to avoid the problem that color pictures cannot be printed.

  2. Solve known bugs in transaction printing API

  3. Adapt to self-developed printer firmware PC80, PC58

  4. Solve the problem that the default initialization jar package automatically connects to USB to avoid the problem of quickly obtaining the printer status of -1 for the first time.

  5. Support Code128 A B C type to print long data

  6. Optimize the text printing image processing algorithm to solve the problem of garbled printing images in D4RK3288

  7. Optimize the printing image algorithm to solve the problem of Barcode19 garbled characters printed by D1 devices

  8. Logic adjustment of resetDevice(): 1. Set the printer status to -1 to logically delete the printer status. Setting the printer status to -1 will only be executed when the connection is disconnected or the transmission fails. 2. The printing thread is unlocked.

  9. Solve the problem that part of the content of JS printed pictures is erased

  10. The API related to transaction printing has been added to support model judgment. If the model does not support transaction printing, there will be no response when calling the API.

  11. (Only supports self-developed PC58/pc80 printers) New QR code api printPDF417, printMaxiCode, printAztecCode, printDataMatrix

  12. (Only supports self-developed PC58/pc80 printers) One-dimensional code adapts to GS1128, GS1DataBarOmnidirectional, GS1DataBarTruncated, GS1DataBarLimited, GS1DataBarExpanded

  13. Added API to determine whether it is a self-developed printer firmware: mIminPrintUtils.isPC80();

  14. Added a new method for printing color pictures printSingleColorChartBitmap(Bitmap bitmap,int isScale) // bitmap target picture, isScale == 1 for equal proportion enlargement, 0 for default size printing

Download SDK v1.3.1

Version 1.2.0

05/21/2024

  1. Transaction print switchover failed to print problem resolved

  2. D1 Transaction print adaptation (23-12-07B1 printer firmware started to adapt, the old firmware is not supported)

  3. After switching device manager printing, print data duplication bug

  4. Transaction printing sometimes returns values without callback issues resolved

  5. USB to obtain printer status -1 USB read thread crash bug resolved

  6. USB read return value timeout resolved

  7. PC58 print double QR code adaptation (Currently only the latest ROM for M2 Max is supported)

  8. Optimize the problem of high cpu usage in the stationary state of the printer

  9. Switch device manager in switch back to print duplicate questions

  10. ADAPTS to self-developed printer firmware (Currently only the latest ROM for M2 Max is supported)

  11. Print picture setup alignment bug

  12. Added transaction printing function

  13. D4 Cannot get the printer status after clicking initialize, and cannot print the first time

  14. D4 Click Transaction Print, send three strokes to print garbled characters

  15. Bluetooth print repeatedly causes disconnection and reconnection after calling initPrinter repeatedly

  16. Print picture Settings Center Left right problem Print Settings fail for several consecutive times

  17. Call initPrinter during transaction printing, print interruption problem

  18. Unable to continue printing after call disconnection Problem resolved

  19. Third party library rxjava referenced by SDK, Observer subthread data switching main thread problem resolved

  20. Print picture setup alignment bug

  21. Adaptive Printer Firmware (PC58) (Currently only the latest ROM for M2 Max is supported)

Download SDK v1.2.0

version 1.1.0

05/21/2024

  1. Compatible with PC58 and PC80 printers

  2. Solve the bug of alignment in printing picture settings

  3. Added transaction printing function

  4. Solve the problem that D4 cannot obtain the printer status after clicking initialization and cannot print for the first time.

  5. Solve the problem of D4 clicking transaction print and printing garbled characters after sending three transactions.

  6. Solve the problem of Bluetooth printing causing disconnection and reconnection after repeatedly calling initPrinter.

  7. Solve the problem of printing picture settings being centered, left, and right. The print settings fail multiple times in a row.

  8. Solve the problem of calling initPrinter during transaction printing and printing interruption.

  9. Solve the problem of being unable to continue printing after calling disconnection

  10. Solving the problem of main thread switching of Observer sub-thread data in the third-party library rxjava referenced by the SDK

  11. Solve the bug of setting alignment of printed pictures

Download SDK v1.1.0

Use an external printer

iMin printers mainly include two types: built-in printers and external independent printers. This document mainly introduces the quick use of external printers through SDK;

Before developing a printer program, you need to have a certain understanding of the working principle of a receipt printer and the ESC/POS instruction set in order to understand the basic knowledge required for receipt typesetting;

Current external printers include:

  1. HPRT Printer

  1. SEIKO Printer