Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Image Printing via Bluetooth Printer (Citizen CMP 30)

$
0
0

Hello, has anyone been successful in printing a image via bluetooth printer using the bluetooth socket? I am able to print the text using the following code but have no lunch with png images...looking for some direction. Thanks all!

                BluetoothSocket socket = null;
                    BufferedReader inReader = null;
                    BufferedWriter outReader = null;
                    string bt_printer = AdminSettings.PrinterMACAddr;
                    if (string.IsNullOrEmpty(bt_printer)) bt_printer = "00:13:7B:49:D1:8C";
                    BluetoothDevice mmDevice = BluetoothAdapter.DefaultAdapter.GetRemoteDevice(bt_printer);
                    UUID applicationUUID = UUID.FromString("00001101-0000-1000-8000-00805F9B34FB");
                    socket = mmDevice.CreateRfcommSocketToServiceRecord(applicationUUID);
                    socket.Connect();
                    inReader = new BufferedReader(new InputStreamReader(socket.InputStream));
                    outReader = new BufferedWriter(new OutputStreamWriter(socket.OutputStream));
                    byte[] printformat = { 0x1B, 0X21, FONT_TYPE };
                    //outReader.Write(printformat);
                    outReader.NewLine();
                    outReader.Write(text);

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>