Need also the algorithm for calculating the checksum, and the new barcode
string, if it is necessary for the font, please.
Need sample code for VB. 6.0 (for the algorithm) or the algorithm for
calculating the checksum, please.
Thanks :)
http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=48268&ln
gWId=1
http://www.vbdiamond.com/ViewSource.aspx?Type=VB&ID=106026
Or for a control to do it for you:
http://www.mabry.com/barcod/
NickHK
"Eitan M" <no_spam_please@nospam_please.com> wrote in message
news:usU5pmGr...@TK2MSFTNGP14.phx.gbl...
"Eitan M" <no_spam_please@nospam_please.com> wrote in message
news:usU5pmGr...@TK2MSFTNGP14.phx.gbl...
http://www.barcodeisland.com/symbolgy.phtml
Regards,
Saga
"Eitan M" <no_spam_please@nospam_please.com> wrote in message
news:usU5pmGr...@TK2MSFTNGP14.phx.gbl...
Thanks :)
"Saga" <anti...@somewhere.com> wrote in message
news:u5hTD5Kr...@tk2msftngp13.phx.gbl...
NickHK
"Eitan M" <no_spam_please@nospam_please.com> wrote in message
news:#ONjmnTr...@TK2MSFTNGP15.phx.gbl...
I don't remember if this is the smallest font (I need at most 14 characters,
with the character "=" included as one of the 14 characters),
How can I control the height of the printed barcode ?
Also, what is the minimum font size for printing ?
Thanks :)
"George Bashore" <gbas...@bcpl.net> wrote in message
news:OiOjKXI...@TK2MSFTNGP15.phx.gbl...
Thanks :)
Is there any simmiliar link for 9 of 3 ?
Thanks :)
"Eitan M" <no_spam_please@nospam_please.com> wrote in message
news:eazjZBUr...@TK2MSFTNGP10.phx.gbl...
For producing bar code in a Visual Basic program, the best tool to use
would be a bar code ActiveX control. Bar Code ActiveX controls will be
both easier to use as well as more flexible regarding the size of your
bar codes than a bar code font. They also calculate check digits for
you and add all start and stop codes so all you need to do is set the
type of bar code that you want, set the size parameters and then pass
in the message that you want to encode.
The best bar code ActiveX control on the market is available from TAL
Technologies and you can download a fully functional demo complete
with sample VB source code at:
http://www.taltech.com/products/activex_barcodes.html
> How can I control the height of the printed barcode ?
> Also, what is the minimum font size for printing ?
Barcode fonts are not very reliable at small sizes, because the error
between intended width and actual width (and placement) of each bar can be a
large percentage when there are not many "printer pixels" per bar. In such
cases you are far better off drawing the barcode yourself, which will allow
you to get down to quite low sizes with fair accuracy. I don't know much
about barcodes themselves (never used 'em) but here is an answer I posted in
another newsgroup (because of my interest in VB printing and graphics) some
time ago that shows how easy it is to "roll your own". I used the UPC
barcode for the example, simply because it was the first one that I managed
to get detailed design information on. Paste the code into a VB Form
containing a command button and give it a try.
Mike
Option Explicit
Private chardata(0 To 9) As String
Private Sub Form_Load()
' note that every digit in the UPC (Universal Product Code
' barcode has an overall thickness of "seven thin lines"
' (a total of 84 "thin lines" for the 12 digits. In addition
' there is a total of 11 thin lines for the start, centre
' and stop codes. Therefore each bar code has a total
' thickness of 95 "thin lines".
chardata(0) = "3211"
chardata(1) = "2221"
chardata(2) = "2122"
chardata(3) = "1411"
chardata(4) = "1132"
chardata(5) = "1231"
chardata(6) = "1114"
chardata(7) = "1312"
chardata(8) = "1213"
chardata(9) = "3112"
End Sub
Private Sub PrintBarCode(code As String, x As Single, _
y As Single, barwidth As Long)
Dim oldmode As Long, nchar As Long
Dim nline As Long, clr As Long
Dim xp As Long, yp As Long, high As Long
Dim wide As Long, n As Long, digit As Long
'pixwide = printer.scalex(barwidth
oldmode = Printer.ScaleMode
Printer.ScaleMode = vbPixels
' concert x and y to the nearest whole number of printer
' pixels (add error checking later)
xp = Printer.ScaleX(x, oldmode, vbPixels)
yp = Printer.ScaleY(y, oldmode, vbPixels)
high = barwidth * 60 ' typical ratio of height to width
' of a single line
'
' draw the "start code" of "111"
wide = barwidth * 1
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), vbBlack, BF
xp = xp + wide
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), vbWhite, BF
xp = xp + wide
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), vbBlack, BF
xp = xp + wide
' now print digits 1 to 6
clr = vbWhite
For nchar = 1 To 6
digit = Val(Mid$(code, nchar, 1))
For n = 1 To 4
wide = barwidth * Val(Mid$(chardata(digit), n, 1))
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), _
clr, BF: xp = xp + wide
If clr = vbWhite Then clr = vbBlack Else clr = vbWhite
Next n
Next nchar
' now print the "centre code" of "11111"
wide = barwidth * 1
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), vbWhite, BF
xp = xp + wide
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), vbBlack, BF
xp = xp + wide
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), vbWhite, BF
xp = xp + wide
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), vbBlack, BF
xp = xp + wide
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), vbWhite, BF
xp = xp + wide
' now print digits 7 to 12
clr = vbBlack
For nchar = 7 To 12
digit = Val(Mid$(code, nchar, 1))
For n = 1 To 4
wide = barwidth * Val(Mid$(chardata(digit), n, 1))
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), clr, BF
xp = xp + wide
If clr = vbWhite Then clr = vbBlack Else clr = vbWhite
Next n
Next nchar
' now print the "stop code" of "111"
wide = barwidth * 1
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), vbBlack, BF
xp = xp + wide
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), vbWhite, BF
xp = xp + wide
Printer.Line (xp, yp)-(xp + wide - 1, yp + high), vbBlack, BF
xp = xp + wide
Printer.ScaleMode = oldmode
End Sub
Private Sub Command1_Click()
' Print some UPC (Universal Product Code) barcodes
Printer.ScaleMode = vbInches
Dim incheswide As Single, pixwide As Long
'
' print barcode at position (1, 1) inches using 7 pixels as
' the width of a thin line (the actual printed size will
' depend on the resolution of the printer).
pixwide = 7
PrintBarCode "639382000393", 1, 1, pixwide
'
' print barcode at position (1, 6.5) inches using 1 pixel as
' the width of a thin line which is the smallest barcode that
' can be printed on the printer (special care should be taken
' regarding printing at such sizes)
pixwide = 1
PrintBarCode "639382000393", 1, 6.5, pixwide
'
' print barcode at position (1, 8.5) at a total barcode size
' of 0.5 inches (actually, at the nearest "whole pixel per
' thin line" value to the desired 1.5 inch size)
incheswide = 0.5 ' desired width of barcode (inches)
incheswide = incheswide / 95 ' 95 thin lines per code
pixwide = Printer.ScaleX(incheswide, vbInches, vbPixels)
If pixwide < 1 Then pixwide = 1
PrintBarCode "639382000393", 1, 8.5, pixwide
'
Printer.EndDoc
End Sub
* * Please include a copy of this message with your reply
Jeff Bennett
Jeff @ Bennet-Tec.Com
* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com
=================== ===================
Code 128 barcodes are the smallest / most compact you can produce.
In message <u7g3i1p454pfaictl...@4ax.com>, Thomas Lutz
<t...@taltech.com> writes
--
Andrew D. Newbould E-Mail: newsg...@NOSPAMzadsoft.com
ZAD Software Systems Web : www.zadsoft.com