作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有 star micronics mpop。我已阅读文档 ( http://www.starmicronics.com/support/mannualfolder/starprnt_cm_en.pdf ) 第 2-8 节指出您可以写入空白代码页。我已按照这些说明进行操作,但仍然无法按预期进行打印。我联系了支持人员,但他们基本上告诉我要使用试错法,因为他们不知道。
它似乎总是打印一串字符。下面是我正在使用的示例代码,仅用于测试我正在为字体 A 发送实心 block ,为字体 B 发送零数据。
[commands appendBytes:
"\x1b\x1d\x3d\x00\x30"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00"
"\x1b\x1d\x74\xff\x80"
length:sizeof("\x1b\x1d\x3d\x00\x30"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00"
"\x1b\x1d\x74\xff\x80")-1];
我们将不胜感激为使这项工作提供任何帮助。
最佳答案
我终于成功地使用命令 ESC GS = n1 n2 da1 da2...
保存一个字符和命令 Esc % = n
打印字符。
下面的示例将一个字符保存到空白代码页的 7F 位置。这应该在每次应用启动时完成,因为它存储在 RAM 中,而不是 NV。
[commands appendBytes:
"\x1b\x26\x01\x01\x7f" //Save the following to position 7F
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00" //end of character
"\x1b\x25\x01\x7f" //Print the character
length:sizeof("\x1b\x26\x01\x01\x7f"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00\xff\x00"
"\xff\x00\xff\x00\xff\x00\xff\x00"
"\x1b\x25\x01\x7f")-1];
在此之后切换回正常代码页也是一个好主意,否则您会产生一些奇怪的副作用。这可以使用命令 Esc GS t n 来完成。其中 n = 0。
[commands appendBytes:
"\x1b\x1d\x74\x00" //Switch back to normal code page
length:sizeof("\x1b\x1d\x74\x00")-1];
关于ios - Star micronics mpop iOS SDK - 使用空白代码页保存和打印字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39041943/
我有 star micronics mpop。我已阅读文档 ( http://www.starmicronics.com/support/mannualfolder/starprnt_cm_en.pd
我是一名优秀的程序员,十分优秀!