与TEXT一起打印条形码 [英] Print Barcode together with TEXT

查看:141
本文介绍了与TEXT一起打印条形码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想知道如何一起打印条形码和文本.我的打印机是爱普生TM-U220B(热敏打印机).可能吗?我使用VB.NET.

怎么做?如果可能的话,请引导我.

非常感谢:doh:

Hi all,
i want to know how to print Barcode and Text together. My printer is Epson TM-U220B(thermal one). Is it Possible? i use VB.NET.

How to do it? if possible ,pls guide me.

Thanks a lot, :doh:

推荐答案

现在,这是如此基础,您是否尝试做任何事情?只需在VB.NET中学习打印(每个初学者的书都涵盖了这一点),然后再做.您可以打印任何内容:文本,条形码作为图像或使用条形码字体,...


除了我之前写的内容之外:如果条码39足够了,只需在Google上搜索免费的条码字体"3of9"即可.如果需要其他条形码类型,则可能需要自己绘制.
Now really, that is so basic, have you tried to do anything at all? Just learn about printing in VB.NET (every beginner''s book covers that) and then do it. You can print whatever you want: text, barcode as image or using a barcode-font, ...

edit:
In addition to what I wrote earlier: If Barcode 39 is enough, just google for the free barcode-font "3of9". If you need other barcode-types, it might be necessary to draw them yourself.


此控件将帮助您生成实际的条形码(假设其格式相同).您正在使用的条形码):条形码.NET控件 [
This control will help you generate the actual barcode (assuming it''s the same format of barcode as what you''re using): Barcode .NET Control[^]

Then, as Smithers-Jones said in their response, just have a look in a VB.net book for an intro to printing text and images. It''s not overly difficult.

Hope that helps :)


答案实际上比您期望的要容易得多.多年来,我一直在与这个问题作斗争,直到在这里找到有关将原始文本发送到打印机的文章为止( http: //support.microsoft.com/kb/322091/EN-US/ [ ^ ])

我不知道vb.net,尽管我确定您可以翻译成:D

然后,您需要使用手册中提供的ESC命令将格式化的字符串发送到打印机,即:
The answer is actually much easier than you would expect. I have been battling with this problem for ages until I found an article on sending raw text to the printer here(http://support.microsoft.com/kb/322091/EN-US/[^] )

I don''t know vb.net although I am sure you would be able to translate this :D

Then all you need is send formatted strings to the printer using the ESC commands supplied in the manual ie:
// Set Barcode height
static byte[] SetBarcodeHeight = new byte[] { 0x1D, 0x68, 0x25 };
// Set Barcode width
static byte[] SetBarcodeWidth = new byte[] {0x1D,0x77,0x03 };
// Begin barcode printing
static byte[] EAN13BarCodeStart = new byte[] { 0x1D, 0x6B, 67, 13 };
string BarcodeString(string barcode)
{
string s = ASCIIEncoding.ASCII.GetString(SetBarcodeHeight);
s+=ASCIIEncoding.ASCII.GetString(SetBarcodeWidth);
s+=string.Format("{0}{1}",ASCIIEncoding.ASCII.GetString(EAN13BarCodeStart),barcode);
return s;
}





现在,您需要做的就是使用上面链接中的RawPrinter将字符串发送到打印机.十六进制代码可在Epson手册中找到.该示例仅适用于EAN13,要更改条形码符号,您只需为每种受支持的条形码类型创建字节数组





Now all you need to do is send the string to the printer using the RawPrinter from the link above. The HEX Codes are available in the Epson manual. This example is for EAN13 only, to change the barcode symbology you would just need to create byte arrays for each supported barcode type


这篇关于与TEXT一起打印条形码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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