使用 CPCL 编程(Zebra 移动打印机)居中收据标题? [英] Centering a receipt title with CPCL Programming(Zebra mobile Printeres)?

查看:76
本文介绍了使用 CPCL 编程(Zebra 移动打印机)居中收据标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用我的 c# 和 CPCL 代码生成收据.我在收据的顶部有公司名称.公司名称是根据使用该软件的人设置的,我希望能够将该公司名称居中.我尝试过命令 CENTER,但它没有做任何我不知道的事情.

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.

我的代码是:

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";

请帮忙

推荐答案

在阅读了一些 this 手册,您在行打印模式下使用,因此您可以仅证明条形码而不是文本.

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.

(从 P9-15)

BARCODE 命令受对齐影响像!U1中心".

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

(从 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

希望有所帮助.

这篇关于使用 CPCL 编程(Zebra 移动打印机)居中收据标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆