如何在蓝牙热敏打印机上打印Unicode字符

时间:2018-11-30 10:10:28

标签: android unicode bluetooth thermal-printer

我正在开发一个Android应用程序。此应用程序应该能够在Bluetooth热敏打印机 SPRT T10 BT 上进行打印,我需要使用此打印机同时打印英语和泰米尔语字样。但是很遗憾,该打印机不打印任何泰米尔语单词。但这完全适用于英语单词。我也尝试了一些泰米尔Unicode,但对我来说不起作用。请帮助我找到解决方案。

我正在关注本教程。

https://github.com/imrankst1221/Thermal-Printer-in-Android/blob/master/ThermalPrinter/app/src/main/java/nullpointer/thermal/printer/MainActivity.java

Printing Unicode Characters From android to bluetooth thermal printer

但是这些教程对我不起作用。

MainActivity.java

public void printUnicode() {
        try {

            mService.write(PrinterCommands.ESC_ALIGN_CENTER);
            printText(Utils.UNICODE_TEXT1);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

private void printText(byte[] msg) {
        // Print normal text
        mService.write(msg);
        printNewLine();
    }

Utils.java

public static final byte[] UNICODE_TEXT1 = new byte[] {0x0D, 0x45, 0x45,
            0x45, 0x45, 0x45,0x45, 0x45, 0x45,0x45, 0x45, 0x45,0x45, 0x45, 0x45,
            0x23, 0x23, 0x23,0x23, 0x23, 0x23,0x23, 0x23, 0x23,0x23, 0x23, 0x23,
            0x23, 0x23, 0x23};

0 个答案:

没有答案
相关问题