问题
I've built an e-shopping website for a big company which has country offices.
What i want to do is the following
- Generate barcode via PHP before sending package to country offices of company
- When the item will be arrived to country office, workers will login to their account, scan this barcode via barcode reader (which located on package) and website will automatically "approve" that item received.
Is it possible only with web interface? I mean without any local application. How to do that? PLease explain.
回答1:
so here is an approach that could work for you:
You need to put a record in a database like:
package_id | name | status 1234 My Package shipped
Generate a barcode which contains the package_id, you have to decide what kind of barcode you want to use. You could also use a data matrix. Then you create the bar code as image so that you can print it. Data Matrix is very good for large custom data.
- A jQuery Barcode Generator: http://barcode-coder.com/en/barcode-online-generator-2.html
Print the bar code, put it on your package
The package arrives at the office, the user logs on to your website, clicks on "Confirm Package Received" or whatever. Then there is a text-field, he focuses the text-field, scans the barcode/data matrix and your package ID "1234" will appear in the text-field
Submit the form, lookup the entry in the database, change it to:
package_id | name | status
1234 My Package delivered
A Tip If you use a QR Code it can be read by many mobile phones, so you don't need a real bar code scanner. You could write an app that reads the bar code and sends the package_id to your server.
回答2:
Tcpdf has a few classes for generating barcodes:
http://www.tcpdf.org/doc/code/classTCPDFBarcode.html
With good examples:
http://www.tcpdf.org/examples.php
For example the first:
// set the barcode content and type
$barcodeobj = new TCPDFBarcode('http://www.tcpdf.org', 'C128');
// output the barcode as HTML object
echo $barcodeobj->getBarcodeHTML(2, 30, 'black');
回答3:
Check larsjung.de/qrcode/
It's JQuery Pluggin, but works well with PHP.
As I see your scenario, you need more than just 1D Barcode. You need QR Code.
Hope this helps.
回答4:
First, you need to chose which barcode type you want to generate. There are multiple to consider, 1D or 2D. 1D barcodes are simple encode only a small amount of data. 2D barcodes are bigger and can encode more data, they are also a little more aesthetic :) If you go for a 2D barcodes, I would recommend QRCode, or DataMatrix. The PDF417 is a viable option if you need to lay your data more horizontally instead of squared. You can find more information here: http://www.barcodebakery.com/en/resources/guide/php/choosing-barcodes
Once you found your code to write, you consider which reader to get. I currently own a Metrologic Focus FirstFlash MS1690. It reads all the barcodes mentioned above. They are multiple options here again, the easiest is to get a USB barcode reader: when you scan a barcode, it would simply write it to the screen as someone were typing it on the keyboard.
回答5:
I'm not sure if I completely understand your question, but if you are looking make a file that can be printed as a barcode, you'll need to know what kind of files your barcode printer can print.
And if you are looking to read a barcode with a scanner into a webform, the scanner needs to recognize the barcode type. The scanner inputs the barcode value into the webform (or any other program that accepts text). The webform has nothing to do with recognizing a barcode.
回答6:
I'm looking at Zend barcode to do something similar, but admittedly I'm only getting started. I'm eager to know how others handle this.
回答7:
This is possible to make using php only. For this you need to take any ready php class to generate qr-code or barcode. Generating barcode may be performed with means of just selecting appropriate bacode font, so, instead of writting numbers php will be writing by barcoded digits. Reading of barcode was described above.
来源:https://stackoverflow.com/questions/7894228/generating-and-reading-barcode