Star micronics mpop iOS SDK – 使用空白代码页保存并打印字符

我有明星微米级mpop。 我已阅读文档( http://www.starmicronics.com/support/mannualfolder/starprnt_cm_en.pdf )第2-8节说明您可以写入空白代码页。 我已按照这些说明操作,但仍无法按预期进行打印。 我联系了支持,但他们基本上告诉我使用他们不知道的反复试验。

它似乎总是打印一串字符。 下面是我正在使用的示例代码,仅用于测试我发送字体A的实体块和字体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];