Facing issue with printing £ symbol with star micronics SDK?

时光怂恿深爱的人放手 提交于 2019-12-13 08:28:18

问题


I have star micronics mPOP 2-inch bluetooth printer and I have integrated star micronics iOS SDK into my application.

I can't print '£' symbol with star micronics sdk. Anyone knows what is the code to print £ symbol?

I found the similar question for other symbol but it doesn't meet my requirement.

URL : how to print € symbol with star micronics SDK?

Thanks in advance.


回答1:


Finally got the solution with following code.

Code to print '£' symbol.

[commands appendBytes:"\x1b\x1d\x74\x04"
               length:sizeof("\x1b\x1d\x74\x04")-1]; 
[commands appendBytes:"\x9c"
               length:sizeof("\x9c") - 1];

Here is the reference link for other symbols.

URL : https://en.m.wikipedia.org/wiki/Code_page_858

Thanks @Paulw11 for the help.




回答2:


You can use these documents to print any character using the character code tables to find the table and the character position: http://www.kioskproapp.com/api/StarPrinter/star-character-code-table.pdf

For example, the £ symbol would be on page 3, position 9C. You can then change the code page using the command ESC GS t n. where n is the page number.

"\x1b\x1d\x74\x03"

Find more info on this command at http://www.starmicronics.com/support/mannualfolder/starprnt_cm_en.pdf page 2-4.

Then you can simple print the £ sign by printing 9c

"\x9c"

Remember to change back to code page 0, or you might see some odd characters:

"\x1b\x1d\x74\x00"

If you can't find the character in any of the tables then you can save your own to memory. Check out this post for more info about that: Star micronics mpop iOS SDK - Save and print a character using the blank code page




回答3:


For someone landing on here from Android and have spent hours finding it. Do this:

builder.appendInternational(ICommandBuilder.InternationalType.UK); builder.append((byte) 0x23); //imagine searching through those numbers one by one!



来源:https://stackoverflow.com/questions/38865680/facing-issue-with-printing-%c2%a3-symbol-with-star-micronics-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!