title: How to Print QR code to bluetooth printer
body: <p>I'm trying to print my generated QR code using bluetooth printer</p>
  
  <p>This how i tried to display</p>
  
  <pre><code>QrCodeCreator.getBitmapFromString(name);
      mmOutputStream.write(center);
      printPhoto(R.drawable.icon);
      mmOutputStream.write(msg.getBytes());
      byte[] command = Utilss.decodeBitmap(QrCodeCreator.getBitmapFromString(name));
      mmOutputStream.write(command);
  </code></pre>
  
  <p>public class QrCodeCreator {</p>
  
  <pre><code>public static Bitmap getBitmapFromString(String qrText) {
      ByteArrayOutputStream out = QRCode.from(qrText).to(ImageType.PNG).withSize(300, 300).stream();
  
      byte[] data = out.toByteArray();
      Bitmap bmp = BitmapFactory.decodeByteArray(data, 0, data.length, null);
      return bmp;
  }
  </code></pre>
  
  <p>}</p>