Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BARCODE IN VB WITHOUT OCX OR FONTS

Status
Not open for further replies.

sagarrasal

Technical User
Nov 1, 2003
7
IN
Dear Friends,

I have gone through most of the threads regarding generation of barcodes in vb and most answers are related to a commercial solution like ocx or dll files which are very costly.In most of the cases, simple programmers cannot afford to buy such controls for just a single project.

As you all know, these dll's or ocx are programmed in vb only, so surely there is a logic available to generate all types of barcodes either by drawing the lines as per specific symbologies like code128/code39 etc. So can anybody help me in encoding these strings and drawing barcodes through code on say a picturebox etc?
I have seen some code somewhere, but now unable to get that link.

Free fonts are only available for code39 and even after searching a lot, there are no free fonts for code128, ITF etc.

Barcode generation through code is more relaible than fonts as you can draw barcode directly on printer which will give more crisp barcodes and will be much more scannable than fonts.

I am sure many of my friends are looking for the same. So this will be common solution for all of them if we get successin drawing the barcode sin vb, I know that this will make sellers of commercial barcode controls unhappy.

Looking forward to get a lot of help from experts.
 
sagarrasal,
I went through the same process looking for dll's to use for barcodes. Finally gave up and designed my own VB for use with a font that I designed. It is for UPC-A and it works great.
I did search for a way to draw lines and found the following. I couldn't get it to work for me so I gave up. The following link lists the VB code for the code39.
jim
 
For specific printer models its quite easy. All you got to do is to send the data sequence to COM1, COm2 or LPT1 etc. These files (COM1, COM2 etc) can be opened using commands like:

OPEN "COM1" for output as 1

Since similar stuff works for me in DOS (Ca-Clipper in my case), I expect it should work in VB.

End.
 
Dear Jim,

Thanks for the quick and valuable reply.
If possible, can you send me the font and the code you designed for upc code? Secondly, since you say that you can develope a font, will it be possible to develope a font which will print a vertical line for 1 and white vertical line for 0. This will enable to print barcodes possibly from a data string of 1 & 0.

I have got some references and working on it and will send you the same if successful.
Secondly, I was expecting a better response regarding the barcode generation form our expert programmer friends as this is a common issue and if a solution is achieved, will benefit most of us, so please share your experiences in barcode generation.

Sagar

 
Sagar,
Reply with your email and I will send you a MDE zip file that you can see.
If you go to my "cheap" website
Press on the "UPC" button (It's still pretty rough.)
The other button "Pictures", leads to my overseas Air Force tours in the late 60's.

jim
 
Dear Friends,

Hope you all have gone throughmy queries regarding barcode generation in VB.

I am expecting replies form expert people like you.
Please co-operate.

Regards
 
Dear Jim,

Thanks for the help till now.

I would love to see your UPC generator and try to learn something more on Barcodes.


Regards,

sagar
pinako@vsnl.com


 
sagar,
I forgot that the font I sent in the zip file is not the same name as the font for the MDE!
Rename the demo font
UPCAshort22.ttf
and most forms should work. The font "Top number", in a few of the forms and reports, is a speciality font I designed that works on my computer at the office but is designed such that the characters appear below most of the fields on the MDB I have at home. If you want to see the workings in the reports make a copy of the upcashort22.ttf and name it
UPCaTopNum.ttf
and install it. While it won't display the way my database is designed it will work. Another font is
UPCA22long.ttf
Make another copy and rename it to the above.
I use the UPC's, "IN HOUSE ONLY" to control my inventory for the few items that do not have UPC's.
jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top