android - 在 Android 中的蓝牙打印机上打印图像

标签 android arrays printing bluetooth

我正在通过蓝牙打印机打印下面的图像。

enter image description here

我指的是这个链接 link用于打印。 图片大小为 100 x 100 像素,图片模式为

public static byte[] SELECT_BIT_IMAGE_MODE = {0x1B, 0x2A, 33, (byte)255, 0};

但不知何故它显示为 image .我尝试了评论中给出的一些选项,但它不起作用。

有人可以帮我吗?在此先感谢

最佳答案

您可以为任何打印机使用 printooth 库,printooth 很简单且有据可查, https://github.com/mazenrashed/Printooth

var printables = ArrayList<Printable>()
var printable = Printable.PrintableBuilder()  
    .setImage(image) 
    .setNewLinesAfter(1) // To provide n lines after sentence
    .build()
printables.add(printable)
BluetoothPrinter.printer().print(printables)

关于android - 在 Android 中的蓝牙打印机上打印图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42901756/

相关文章:

jquery - 打开新窗口打印元素

javascript - 特定 div 上的媒体打印 CSS

java - 摆脱操作栏

android - 有没有办法直接查看和更新​​ SQLite 数据库(类似于 EasyPHP)

android - 在应用内结算 IAB 设置成功但 queryInventory 报告 IAB 助手未设置

c - 字符串数组中不同出现的次数

c# - UnityWebRequest 和/或 HttpWebRequest 在 Android 上使用 PUT 给出 403

javascript - ES6 数组方法用于删除/检测数组中的重复对象

javascript - jquery根据特定位置的特定字符过滤值

java - 我应该使用 System.out.println() 还是其他什么?