请帮我转换dotmatrix打印机的命令代码 [英] Please help me to convert command codes of dotmatrix printer

查看:78
本文介绍了请帮我转换dotmatrix打印机的命令代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如果我错了,请原谅我,因为我是搜索命令代码的初学者。



我正在使用Espon LX300 +打印机并正在使用C#。我试图打印销售单,我需要水平标签空间来对齐列。我得到的命令代码如ESC D n1 n2..NUL,但我这样做

Hi,

Please excuse me if I am wrong because I am a beginner in searching for Command Codes.

I am using Espon LX300+ printer and am working with C#. I trying to print out a sales bill and I need Horizontal tab space to align columns. I am getting command codes like "ESC D n1 n2..NUL" but I am doing like this

MyPrinter.Print("\x0e");
MyPrinter.Print(OdrDetails.deliverychannel );
MyPrinter.Print("\x14");



所以我如何将ESC D转换成这种类型的代码。



我尝试了什么:




So how I convert ESC D like codes to this type.

What I have tried:

MyPrinter.Print("\x0e");
MyPrinter.Print(OdrDetails.deliverychannel );
MyPrinter.Print("\x14");
MyPrinter.Print("    Del.Date : " + OdrDetails.deliverydate);
MyPrinter.Print("\r\n");
MyPrinter.Print("Slip#: "+OdrDetails.invno + "     " + OdrDetails.orderdate);
MyPrinter.Print("\r\n");
MyPrinter.Print("Customer: " + OdrDetails.cstname + "");
MyPrinter.Print("\r\n");
MyPrinter.Print("Add: " + OdrDetails.cstadd);
MyPrinter.Print("\x09");
MyPrinter.Print("\r\n");
MyPrinter.Print("123456.00");

推荐答案

标签大小取决于您选择的字体系列和大小,以及字距调整设置。您唯一可行的办法是提前确定列宽,并在页面上建立X位置,并仅打印适合已建立列宽的字段值部分。



如果是我,我会使用非比例字体让自己更轻松。
Tab size is based on the font family and size that you've selected, as well as kerning settings. Your only viable recourse is to establish your column widths ahead of time, and establish your X position on the page, and only print the portion of the field value that will fit within the already establish column width.

If it were me, I'd use a non-proportional font to make things easier on myself.


这篇关于请帮我转换dotmatrix打印机的命令代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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