Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
Posted
Updated 22-Jun-10 22:46pm
v2

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.
 
Share this answer
 
v3
Comments
Teoh Chia Wei 22-Oct-12 2:30am    
you totally not helpful
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 :)
 
Share this answer
 
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:
C#
// 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;
}




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
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900