用于创建 .TMB 图像的库?
有谁知道适合以 .TMB 格式写入图像的库?
.TMB 格式适合从 Epson 热敏收据打印机打印徽标。
Is anyone aware of a library suitable for writing an image in .TMB format?
The .TMB format is suitable for printing logos from a Epson thermal receipt printer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过大约一个小时左右的查看二进制数据后,我得出以下结论:
使用以下命令:
od -ta -v [YOUR_TMB_FILE] | head
我们可以在 TMB 文件的开头查看二进制数据,即 ASCII 字符数据。
我有一个看起来像这样的文件:
根据 ESC/POS编程指南,打印光栅图像的ASCII命令是:
GS V 0
嗯..有趣!
一时兴起,我决定将
5
和P
转换为其十进制等值,分别为53
和80
,我的 .TMB 图像的确切尺寸(实际上是 80x53)!此后一切都水到渠成。 .TMB 文件的其余部分只是二进制图像数据。
这是我为了测试我的理论而编写的一次性 Python 脚本:
After about an hour or so of looking at binary data, I came to the following conclusion:
Using the following command:
od -t a -v [YOUR_TMB_FILE] | head
we can view the binary data, as ASCII character data, in the beginning of the TMB file.
I had a file that looked something like this:
According to the ESC/POS Programming Guide, the ASCII command to print a raster image is:
GS V 0
Hmm.. Interesting!
On a whim, I decided to convert
5
andP
to their decimal equivalents, which are53
and80
respectively, the exact dimensions of my .TMB image (actually, its 80x53)!Everything fell into place after this. The remainder of a .TMB file is just the binary image data.
Here is a one-off Python script I wrote to test my theory: