Centering a receipt title with CPCL Programming(Zebra mobile Printeres)?

孤街浪徒 提交于 2019-12-25 08:41:36

问题


I am producing a receipt with my c# and CPCL code. I've got company name on the top of the receipt.Company name is setup according to who is using that software, I want be able to center that company name. I have tried with command CENTER but its not doing anything I dont know If I am doing something wrong.

My Code is:

SendData = " ! U1 setvar \"device.languages\" \"line_print\"\r\n";
SendData += " ! U SETLP 5 1 46\r\nPAGE-WIDTH 480\r\nSETBOLD 2\r\nPRINT\r\n";          
SendData += " ! U1 CENTER\r\n"+MobileOrdering.AppSettings.Company+"\r\n! U1 SETBOLD 0\r\n";
SendData += " ! U1 CENTER\r\n";
SendData += " ! U1 SETLP 0 2 24";
SendData += MobileOrdering.AppSettings.Address+"\r\n";

Pls help


回答1:


Well as I understood correctly after reading a bit of this manual, you using in line print mode so you can justify just bar codes not text.

(from P9-15)

The BARCODE command is affected by the justification commands like “! U1 CENTER”.

(from P9-18)

The program must set up the file with all the spacing already inserted. Use only spaces, not tab characters, to make things line up correctly

to test if I'am correct try instead of company name add bar code, if it will be centered - I'am right :)

To add centered text you can also try just use commands in label mode:

! 0 200 200 210 1
CENTER
TEXT 4 3 0 0 Centered Company Name
LEFT
TEXT 4 3 0 0 Text on left
FORM
PRINT

Hope that helps.



来源:https://stackoverflow.com/questions/7158308/centering-a-receipt-title-with-cpcl-programmingzebra-mobile-printeres

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