Question

I need to develop a PHP application that will be generating barcodes and also will have the ability to read those barcodes back.

As my application will be a web based application and underlying technology is PHP which is a server side scripting language, I am feeling that barcode generation will not be an issue but the scanning and reading those barcodes may be a challenge.

Please guide me if its possible to read barcode in a PHP application.

Was it helpful?

Solution

Reading a barcode is usually easy, because barcode readers are usually the same as a normal keyboard, thus writing to the application as if it would be typed by the user. You just need to provide a text field on your page, where the data is entered. The user of course needs a barcode reader.

By adding [Enter] or [Tab] characters to the barcode, you can control to change to the next field or send the form to the server without additional user interaction.

OTHER TIPS

The trick to understanding bar code generation is to realize that a bar code is just an alternative way of writing characters. Some types of bar code have a limited set of characters they can represent (e.g. UPC is a fixed number (usually 13) of characters in the range 0-9)., others such as Code 3 of 9 have a wider range of characters (e.g. Code 3 of 9 is alpha numeric).

So the easiest way to generate bar codes is to use of one of the free Code 3 of 9 fonts, and use that to generate your bar code. You can either use the font in conjunction with the GD library to generate an image, or if you want to generate a PDF containing a bar code just incorporate the characters written in the bar code font directly into the PDF. You may even be able to get a bar code font from one of the web font services such as TypeKit or Google Web Fonts, and just put the bar code directly into the HTML page.

For reading back the bar codes, there's nothing in a normal web browser which will read a bar code and return just the characters. The user of your web app will need to upload an image containing the bar code which you can process on the server. The links that Miqdad Ali posted in his answer might help you do it server side.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top