creating a program for barcode

Posted on 2005-04-06
Last Modified: 2013-11-18

I need to create a program to be able to generate barcode for storage media label only (Like DLT meda tape or LTO media tape). How the concept like? what language use will be easier? How to start with it?

Thanks ;)

Question by:patrick24
    LVL 16

    Accepted Solution

    Look at this site. Could it be of any use?
    LVL 10

    Assisted Solution

    Well you can use VB, C#, or C++ all those languages are suited for that. VB is pretty easy to get started with. What you really need is some sort of component or SDK which handles the barcode parts for you, unless you want to code that yourself. I have never worked with barcodes so I just googled for some SDK's. These may help.

    To use these SDKs you'd write your application, say in VB, and basically use some SDK like these to handle the read/write/printing of them.
    LVL 4

    Assisted Solution

    Being in the programming area I assume that you want to add barcode printing to your application,and nothing fancy.
    There are a few dozens barcode standards in the market, from "UPC" (used in supermarket), high density 2D (like the square in UPS packages) to very simple, like the code 128.
    To print a barcode, you need a special font and then print your text in a prepared string using that font.

    For a simple barcode app, I'm using the font call: Code128B (C128BTT.TTF) no sure where this font came from, is dated 1993!!!
    Code128 allows letters, numbers and some symbols.
    Any basic bar code reader will read/decode this old standard.
    The following code creates the bar code string printed using the Code128 font:
    '   Add the propper prefix, suffix and parity
    Public Function Code128b(txt As String) As String
        ' this routine turns a Text into a Code128B string
        Dim cd      As Long         ' check digit
        Dim i       As Long         '  temp index
        Dim tx      As String       '   local work area
        Dim txo     As String       '    output string
        Dim asx     As Long         '     ascii equivalent
        txo = ""
        cd = 0
        tx = Trim$(txt)
        If Len(tx) > 0 Then
        ' calculate the check digit
            For i = 1 To Len(tx)
                asx = Asc(Mid$(tx, i, 1)) - 32
                If asx < 0 Then
                    MsgBox "Invalid Code128b String!!!" & vbLf & "Replaced by ""?"""
                    asx = 31
                End If
                cd = cd + asx * i
            Next i
            cd = cd + 104           ' add the start code
            cd = cd Mod 103
            Code128b = Chr$(202) & tx & Chr$(cd + 32) & Chr$(138)
            Code128b = ""
        End If    
    End Function

    LVL 2

    Author Comment

    Thank guy :)

    I will check it out. any more suggestion form others? ;)


    Assisted Solution

    I have done some work with barcodes.  We needed some barcodes to be printed on some stickers for an inventory management system.

    What I came up with was pretty simple.  I used Visual Basic to write a VB app (which later became a client side Active X Object for a web page).  The system would tell it which "ID number" to print as a barcode, and the Active X Object would print the sticker.

    I used a free font called Free3of9.

    3 of 9 is a "type" of bar code that handles ascii characters.  Since I was interested only in numbers, this worked out fine for me.  Also, since some of the laser barcode readers we would be using were older, this also worked out well because 3 of 9 is an older "type" of barcode.  It scaled well to our stickers which are about 2.5 inches wide, and maybe an inch tall.

    Essentially, my VB app just printed a number to a printer and used the Free 3 of 9 font.  It took some tweaking to get the font size and position correct, but once it was done, it was done.  The whole thing is simple, and works rock solid.  The software I setup has been used hundreds of times daily for about two years.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: HTML5 Mobile App Development with PhoneGap

    PhoneGap can help you leverage your already existing HTML5, JavaScript, and CSS skills in order to create and deploy cross-platform mobile apps.This program comprehensively covers HTML5 mobile app development from top to bottom.

    Suggested Solutions

    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now