SitePoint Sponsor

User Tag List

Page 2 of 4 FirstFirst 1234 LastLast
Results 26 to 50 of 89

Thread: Create Barcodes

  1. #26
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A quick search around shows PHP Barcode which can possibly handle what you're looking for.

  2. #27
    Non-Member
    Join Date
    Aug 2007
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there any way I can create something that will create barcodes, without using ready made stuff.
    Could CSS Divs be used to achieve this?

  3. #28
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create Code 25 Barcodes

    Hi,

    Using PHP, how do I code a script that creates on-the-fly Code 25 barcodes, using Divs and CSS?
    The barcode value needs to be entered into a text, and the barcode is automatically create based on the value entered in the text box.

    Many Thanks, any help greatly appreciated!
    F10

  4. #29
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take a bite out of PEAR.
    Documentation @ : http://pear.php.net/package/Image_Barcode
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.

  5. #30
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can't this be done using PHP & CSS?

  6. #31
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.

  7. #32
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How?
    The barcode also needs to be scan-able.

  8. #33
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PEAR - PHP Extension and Application Repository, the Image_Barcode package is an application written in php that generates barcodes, read the end user documentation there are examples of how the package works. To get the package use the pear package manager, there is a recent article by article bot that explains how pear works. Take time to read the article and the end user docs that go with the barcode package.
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.

  9. #34
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do I make a script that does it using PHP & CSS?

  10. #35
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,443
    Mentioned
    82 Post(s)
    Tagged
    3 Thread(s)
    Have you tried searching the forum for barcode ?

    Anyway this post came up a couple of days ago and may be of help:
    http://www.sitepoint.com/forums/show...hlight=barcode

  11. #36
    SitePoint Zealot
    Join Date
    Apr 2007
    Location
    New London, CT
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have to learn. Which is what I am gonna do cause that sounds pretty cool. Thanks Byron.

  12. #37
    SitePoint Zealot
    Join Date
    Apr 2007
    Location
    New London, CT
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow! Byron that is ridiculously easy. so I just include that class in my pear repository and the call the function. SICK!

  13. #38
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create Code 25 Barcodes

    Quote Originally Posted by Rubble View Post
    Have you tried searching the forum for barcode ?

    Anyway this post came up a couple of days ago and may be of help:
    http://www.sitepoint.com/forums/show...hlight=barcode
    Yes, all I can find, is how to read barcodes, using Php. Not, how to create Barcodes with PHP.

    The thread found here: http://www.sitepoint.com/forums/show...hlight=barcode isn't that helpful, as it doesn't give you any idea on how its done.

    Now what?

  14. #39
    SitePoint Zealot
    Join Date
    Apr 2007
    Location
    New London, CT
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Search GOOGLE for PEAR, Image_Barcode. Find the Documentation. Read it. Download the PEAR script. Do what the Documentation says. You have barcodes.

  15. #40
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,443
    Mentioned
    82 Post(s)
    Tagged
    3 Thread(s)
    If I wanted to create the barcodes I would find out how the Code 25 barcodes work and create the images.
    I do not know how the code 25 ones work but there must be a specification on the bar sizes and how they work. I know one I was looking at years ago had the numbers from the left to the middle and then the right to the middle so it could be read both ways.

    I have a bit of code on my site that may be of help, the last one on this page http://rubblewebs.co.uk/imagemagick/code.php This is calling up the image to go with the letter. You should be able to adapt that. I would think its quicker to have all the bars ready made up than generate them everytime.

    This is using ImageMagick which I would think is a lot quicker/simpler than GD to get working.

    Note: You could make up an image all in one go if you wanted as the logo on this page is just made up of rectangles http://rubblewebs.co.uk/imagemagick/...?info=logo.gif
    Last edited by Rubble; Aug 22, 2007 at 12:47. Reason: Added note

  16. #41
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So it's not possible to achieve this through PHP, and CSS?
    I want to create a script that develops barcodes, not used a ready made one, if I can help it.

  17. #42
    SitePoint Evangelist
    Join Date
    Aug 2005
    Posts
    453
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use the out of the box php code from the pear repository, why reinvent the wheel when you have one that works already ?
    Computers and Fire ...
    In the hands of the inexperienced or uneducated,
    the results can be disastrous.
    While the professional can tame, master even conquer.

  18. #43
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,443
    Mentioned
    82 Post(s)
    Tagged
    3 Thread(s)
    Once you have made the images you could just put then in a table and that would work or put each image representing a number into a div which may also work.

  19. #44
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it not possible to make the barcode image out of divs?

  20. #45
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Plano
    Posts
    643
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    f10,

    instead of starting COMPLETELY from scratch, why don't you at least take a look at the source code for something that ALREADY creates barcodes (here) . in addition, you should read up on how bar codes are generated and read, so you at least know the direction you need to take, and how to modify the source code provided for you to output to DIV's. a good place to start is Wikipedia

  21. #46
    SitePoint Zealot
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would strongly advise against creating barcodes with divs. In theory, you could work out the specification and generate them, or you could hook into the PEAR class and instead of generating an image generate divs with set widths, but the reason we use an image is that everything is absolute. With a div, the browser can interpret the size incorrectly, the size can change, it may not print properly, there are quite a few problems for something that has to be as precise as a barcode. With an image, a bar has an absolute width on the image and you know exactly what that bar is supposed to represent, everything just works. Are there any particular reasons why you need to do it with CSS divs?

  22. #47
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are there any particular reasons why you need to do it with CSS divs?
    Yes, I want to create my own "Create Barcodes" script, without utilizing any pre-made scripts.

    To solve the div width problem, is it possible to do it through images, have a black image (1px x 1px) and a white image (1px x 1px), to create the bars?

    For example, to create a 3px black line, just join three black images together.

    Many Thanks,

  23. #48
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    Plano
    Posts
    643
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    check out that PEAR script for inspiration so you know which direction to take, and then devise your own class that creates bar codes as you said -- with multiple images side-by-side.

  24. #49
    Non-Member
    Join Date
    Aug 2007
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Create Code 25 Barcodes

    How do I download the PEAR thingy/script?

  25. #50
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,443
    Mentioned
    82 Post(s)
    Tagged
    3 Thread(s)
    I agree with your comments on divs Akash Mehta.

    Pear - http://pear.php.net/


Bookmarks

Posting Permissions

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