SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2009
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Barcode Reading and writing

    I am developing a web application that requires barcode printing and then reading using bar code scanner.

    My questions are the below -

    1.Can i use any bar code scanner or i need any specific one which will work with PHP?
    2.How the bar code printing will be done??Do i need to use any class for it?

  2. #2
    SitePoint Evangelist smftre's Avatar
    Join Date
    Dec 2008
    Location
    London
    Posts
    436
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1.) as long as it can scan and convert the code to text (most work just fine)
    2.) most barcode readers convert the barcode into an alphanumeric string then they append a return/line carriage to the end so as to end the code off.
    You can process them quite easily once you have the code, you can send via javascript or just straight to your HTML form's input fields
    Statvoo.com The Website Traffic Monitor
    The best way to monitor traffic to your sites for free!


    Web Development London UK We make web 3.0 applications

  3. #3
    SitePoint Evangelist AlienDev's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP is almost certainly the wrong language if this needs to be fast.

    You would be better writing it in C (or use an open source C application) and execute using shell_exec().
    Me on StackOverflow | Blog & personal website.

    I mostly use: PHP, Java, JavaScript, Android.

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The server side language should be totally irrelevant since if you are using a bar code reader as input to a web page then it is simply providing the form field content instead of it being entered via the keyboard.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2009
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    The server side language should be totally irrelevant since if you are using a bar code reader as input to a web page then it is simply providing the form field content instead of it being entered via the keyboard.
    So Felgall - you think any barcode reader should work with php? and i should go ahead with such application in php.

    What do you suggest for barcode printing - what the barcode printing has to be done in the application in a certain area in the application

  6. #6
    SitePoint Enthusiast
    Join Date
    Aug 2009
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,868
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by shehzad.rsi View Post
    So Felgall - you think any barcode reader should work with php? and i should go ahead with such application in php.

    What do you suggest for barcode printing - what the barcode printing has to be done in the application in a certain area in the application
    The bar code reader isn't working with PHP - it is working with the operating system of the local computer. It is just another input device that if properly configured will work just like a keyboard.

    For barcode printing you just need to select and install the appropriate barcode font and then output the content using that font. Since you can't guarantee that your visitors will have the appropriate barcode font installed on their computer you can't guarantee that an HTML web page will be able to display the barcode. If you generate a PDF instead (eg using the PHP library from fpdf.org) then you can install the appropriate barcode font onto your site to work with that in generating a PDF. I know that this works because I have written PDFs generated this way that include barcodes.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Tags for this Thread

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
  •