首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Star micronics mpop iOS SDK -使用空白代码页保存和打印字符

Star micronics mpop iOS SDK -使用空白代码页保存和打印字符
EN

Stack Overflow用户
提问于 2016-08-19 22:47:15
回答 1查看 245关注 0票数 2

我有微电子的明星音乐。我已经阅读了文档(http://www.starmicronics.com/support/mannualfolder/starprnt_cm_en.pdf)第2-8节指出,您可以写入空白代码页。我已经遵循了这些说明,但我仍然无法按预期打印出来。我联系了支持,但他们基本上告诉我使用试错法,因为他们不知道。

它似乎总是打印一个字符串。下面是我正在使用的示例代码,只是为了测试,我为字体A发送了一个实心块,为字体B发送了一个零数据。

代码语言:javascript
复制
[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];

任何帮助这项工作的人都将不胜感激。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-27 00:09:57

最后,我使用命令ESC GS = n1 n2 da1 da2...保存字符,并使用命令Esc % = n打印字符,最终使其正常工作。

下面的示例将一个字符保存到空白代码页上的7F位置。这应该在每个应用程序启动时完成,因为它存储在RAM中,而不是NV中。

代码语言:javascript
复制
[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。

代码语言:javascript
复制
[commands appendBytes:
         "\x1b\x1d\x74\x00" //Switch back to normal code page
length:sizeof("\x1b\x1d\x74\x00")-1];
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39041943

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档