Generate barcode from a string in java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • freethinker
    New Member
    • May 2009
    • 17

    Generate barcode from a string in java

    Hello
    I have a table of players, each player in the team should have unique barcode:



    The barcode scanner returns an array of chars.
    The next player_id = char++, example:
    aaa
    aab
    aac
    ...
    aba
    aca
    ..
    baa


    Or muybe another solution?


    Kr,
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Both UPC and EAN barcodes encode just sequences of digits; which encoding do you have in mind?

    kind regards,

    Jos

    Comment

    • freethinker
      New Member
      • May 2009
      • 17

      #3
      Thanks but i am sorry to say I don't understand your response.
      I asked what should I do to generate a barcode on basis of an array of chars?

      All I know is when I take the barcode reader and scan a barcode, the output is like this in (player_id)


      Kr,
      F.

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by freethinker
        Thanks but i am sorry to say I don't understand your response.
        I asked what should I do to generate a barcode on basis of an array of chars?

        All I know is when I take the barcode reader and scan a barcode, the output is like this in (player_id)


        Kr,
        F.
        I don't think that barcode reader gives your (16 bit or utf-8) chars; it just gives you bytes. Read those bytes and use them as a unique id.

        kind regards,

        Jos

        Comment

        • freethinker
          New Member
          • May 2009
          • 17

          #5
          Originally posted by JosAH
          I don't think that barcode reader gives your (16 bit or utf-8) chars; it just gives you bytes. Read those bytes and use them as a unique id.
          Thank you, that is what I also do, the string or bytes I get as return value when I read a barcode with barcode reader, I use it as unique id.

          I am now looking for a good working solution on how to generate a barcode which gives you the code (bytes for example) you have in the table as unique id.

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by freethinker
            Thank you, that is what I also do, the string or bytes I get as return value when I read a barcode with barcode reader, I use it as unique id.

            I am now looking for a good working solution on how to generate a barcode which gives you the code (bytes for example) you have in the table as unique id.
            I don't understand what you want then; you have a unique key (a byte[] array) produced by your barcode reader; you have your data that belongs to that key so what other key do you want?

            kind regards,

            Jos

            Comment

            • freethinker
              New Member
              • May 2009
              • 17

              #7
              Originally posted by JosAH
              you have a unique key (a byte[] array) produced by your barcode reader;
              true
              Originally posted by JosAH
              you have your data that belongs to that key
              true
              Originally posted by JosAH
              so what other key do you want?
              a mathod to produce a barcode (some graphics you can print out for the player).

              thank u

              kr,
              e

              Comment

              • JosAH
                Recognized Expert MVP
                • Mar 2007
                • 11453

                #8
                Originally posted by freethinker
                a mathod to produce a barcode (some graphics you can print out for the player).
                That's easy; there are numerous packages available that can print barcodes for you; google for "print barcode Java" and see for yourself.

                kind regards,

                Jos

                Comment

                Working...