蓝牙热敏打印机打印半个字符串

Bluetooth Thermal printer print half String

请帮助我,我浪费了我一整天的时间却无法弄清楚为什么我的热敏打印机在收据上打印了一半文本。它在 58mm Mini Bluetooth Thermal Printer 中完美运行。但是当我使用热敏打印机时 LESHP 80mm Wireless Bluetooth Thermal 这台打印机只打印收据中的一半文本。

这是我的代码:

void findBT() {

    try {
        mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

        if (mBluetoothAdapter == null) {

        }

        if (!mBluetoothAdapter.isEnabled()) {
            Intent enableBluetooth = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
            startActivityForResult(enableBluetooth, 0);
        }

        Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();

        if (pairedDevices.size() > 0) {
            for (BluetoothDevice device : pairedDevices) {

                if (device.getName().contains("Printer")) {

                    mmDevice = device;

                }
            }



        }
        else {
            Toast.makeText(this,"device not pair.",Toast.LENGTH_LONG).show();
        }

    } catch (Exception e) {
        e.printStackTrace();
    }
 void SendDateBT() throws IOException {
    try {

        // Standard SerialPortService ID
        UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb");


        mmSocket = mmDevice.createRfcommSocketToServiceRecord(uuid);

        mmSocket.connect();
        mmOutputStream = mmSocket.getOutputStream();
        mmInputStream = mmSocket.getInputStream();
        mmOutputStream.write(mytext.getBytes());

        mmOutputStream.flush();
        mmOutputStream.close();
        mmInputStream.close();
        mmSocket.close();

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

我想打印收据时调用这两个函数:

findBT();
SendDatBt();

我在写入数据后使用暂停,在刷新并关闭连接之前尝试 1-2 秒。 这是我写的应用程序:https://play.google.com/store/apps/details?id=pe.diegoveloper.printerserverapp

经过大量搜索和它对我的工作,我尝试了这个。

mmOutputStream.write(Mytext.getBytes(Charset.forName("UTF-8"‌​)));