Results 1 to 16 of 16
  1. #1
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default Question regarding barcode generating

    If anyone has experience with those - is it a simple function to create? i.e. can I generate valid barcodes (text and picture) within a few thousand LOCs?

    Or what about if I leave the picture separate and only focus on generating a valid barcode number in my code? (the user can use other free exe files to take the number and generate a picture from it)

    I saw a few free java barcode generator librarys on the web, but one of them was not actually free and the other one was 60MB file (which I'd need to be crazy to implement in my project since my project is currently only 1.5MB).

    Can you point me to any good tutorial for generating valid barcodes or any good, lightweight library that I can use in my project?

    thanks

  2. #2
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    Hi ozzyman,

    I am currently writing applications at work that generate bar codes and read them. The first thing you should specify is the type of bar code you need.
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  3. #3
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    Hi flynn, thanks. I did notice the different names e.g EAN-13 etc, but I don't know what is the most commonly used for the project i'm working on - Point of Sale system?

    I wonder if you know whats best?
    Last edited by ozzyman; 04-17-2011 at 12:53 PM.

  4. #4
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    I pressume the PoS systems use the stripy bar code. Or do you need to use QR Code
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  5. #5
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    Okay, stripy (1D) barcode is definately what I need.

    2D barcodes is extra and I don't think many people use it yet. That said, if having both is easy to implement then that would be a bonus.

  6. #6
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    Ok, well I am not sure about the 1D, but I've seen some info how to generate the ones you need without other libraries. This seems pretty simple. I only work with 2D qrcodes, for which you will need separate libraries if you decide to implement them in the future. QREncode and QRDecode.
    Hope any of this helps.
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  7. #7
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    Ok thanks i'm gonna check out the link now, but I have another question. I plan on automatically generating a barcode when the user creates a new Product (so each Product has a barcode on the system) and then giving the user an option to print the barcode so they can stick it on the physical product (so if the system has a barcode scanner, the code can be read again, and the correct product selected from the system). So QR codes can be used. But is this the right way about doing it? I mean, barcodes aren't globally defined are they? So that - if the business sell products that aren't their own and has its own barcode - it wont interfere sort of thing?

  8. #8
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    Btw I found a nice site on explaining how to validate a code (which is what I actually need to generate valid codes)

    EAN-13 - How To

  9. #9
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    To generate a bar code you will have provide data to be encoded in the bar code. Now, if the product already has a bar code stuck onto it, the company that generated the bar code might have a certain format for the data encoded in their bar code. If you can decode their bar code, i.e. see in what format the data is encoded, you will now how not to encode your bar codes. Another thing, If you clearly mark your bar code, different companies will now that its not their bar code if they need to scan it. They aren't globally defined.
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  10. #10
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    Quote Originally Posted by ozzyman View Post
    Btw I found a nice site on explaining how to validate a code (which is what I actually need to generate valid codes)

    EAN-13 - How To
    You will still need to decode the bar code and then do the calculations like they were shown in the link you posted.
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  11. #11
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    Oh right, so after the barcode is scanned with a laser it needs to be decoded first? - I'll focus on that a bit later when I buy the equipment to test my software with. For now I'll just use a 'fake' county code representing my software, and make any 'manufacturer' code based on the user (see the link i posted for the breakdown of EAN-13 codes). Then i'll set up my functions to read the code and match it to the product.

    Thanks again for your help.

  12. #12
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    Yeah, the laser scans it, your software decodes it and displays it as text. Scanner really works as a keyboard. If you have a scanner, open up excel, select a cell and scan some random codes (anything that has a bar code). You will see that the values will look as if they were just typed in very quickly.
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  13. #13
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    Ok I read a few guides about UPC/EAN codes and I think I know how to do it now and it should be pretty simple!

    Each digit relates to a four-digit set of bars:

    0 = 3211; 1 = 2221; 2 = 2122; 3 = 1411; 4 = 1132;
    5 = 1231; 6 = 1114; 7 = 1312; 8 = 1213; 9 = 3112

    each number in the four-digit set relates to the thickness of the line, 4 being highest, 1 being thinnest

    Notice every four-digit code for each number adds up to 7,
    so each number only takes up 7 lines.

    Every EAN code starts and ends with 101, and has 01010 after 6 digits

    Also the black and white bars together make up the code.

    The thickness of the line has 4 standard sizes: 1, 2, 3, or 4,
    so you can decode the barcode by looking at the thickness and
    labelling the thickest lines "4", thinnest "1" and the other two "2" and "3".

    The image i attached of the barcode can be decoded to this:

    101

    2221 (1)

    1411 (3)

    2122 (2)

    3211 (0)

    2221 (1)

    1411 (3)

    01010

    1312 (7)

    3211 (0)

    2221 (1)

    1213 (8)

    1231 (5)

    3211 (0)

    101

    Also I think the barcode scanner just gives the full code e.g.
    101 [XXXX]{6} 01010 [XXXX]{5} 101

    so it should be easy to decode it in java using the four-digit sets of bars
    Attached Thumbnails Attached Thumbnails Question regarding barcode generating-barcode.gif  
    Last edited by ozzyman; 04-17-2011 at 05:19 PM.

  14. #14
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    Ahhh man this is very cool. I like the nitty gritty of how things work. :)
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  15. #15
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default

    Yah me too lol :). Btw after all of this....... I just noticed that all the products around me have the companies own random barcodes!! 'Random' meaning not any standard barcode, but their own private barcodes. But its still great to know how this works because now I can make my system read & scan other products and allow them to be sold.

  16. #16
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default

    The only standard thing about these bar codes is the thickness from 1 to 4.
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

Similar Threads

  1. Barcode creation
    By grupobfx in forum Reviews / Advertising
    Replies: 0
    Last Post: 04-13-2011, 05:29 PM
  2. Replies: 0
    Last Post: 03-01-2011, 08:57 AM
  3. Barcode Reader
    By kaotic101 in forum New To Java
    Replies: 3
    Last Post: 01-03-2011, 06:10 PM
  4. Replies: 0
    Last Post: 09-16-2010, 12:54 PM
  5. How to create a barcode
    By naveen.dpt2007 in forum New To Java
    Replies: 2
    Last Post: 02-04-2010, 03:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •