[Gloucs] Hello I ve read your post on newsgroups about barcoding

Guy Edwards gloucs at mailman.lug.org.uk
Sat Jul 26 13:53:01 2003


On Fri, 2003-07-25 at 19:44, Anthony Nguyen wrote:
> Hello,
>=20
> I=FFm writing a POS application, and I would like to know if you found =
a

POS? I hope that's PHP Open Source and not what POS normally stands for
:-)

>  solution for printing barcodes from PHP on a sheet of stickers. I am

Yes and no. Not on a sheet of stickers but almost as good.

>  thinking about generating a PDF but I would like to know if there was
> nothing already done to do this.

Well, what I did in the end was to add a GPL PHP barcoding app into my
own app, and then use a barcoding printer to make stickers the right
size - something like this:

1. In my app I select an item (like in a shopping cart situation).
2. Selecting the items uniqueID brings up a barcode image in a small
window of the unique id.
3. Printing that window onto a printer such as:
http://www.dabs.com/products/prod-search.asp?action=3Dsearch&tid=3D340&ob=
=3Dprice&stab=3Dref
(select "Smart Label Printer 100 203dpi" for further info)
will automatically create a label for you. It's not a sheet of A4
stickers but it doesn't involve wasting a sheet of A4 each time for one
sticker.

If storing the data in MySQL I think the uniqueid (or whatever you use
for the barcode) has to be an even number of digits and also you need to
fill the field with 0's so that item 1 becomes 0000000001 (which is just
an SQL statement which escapes me right now). These aren't MySQL
limitations of course, it just makes all the barcoding easier.

Initially I looked at using:
http://www.mribti.com/barcode/home.php
But settled on this application (php-barcode) instead in the end:
 http://www.ashberg.de/bar/download/
  note: you need to download + install the GNU barcode program first=20
http://www.gnu.org/directory/GNU/barcode.html
        then genbarcode from the first link=20
        then php-barcode from the first link.

Just one more thing:
When using my USB barcode scanner, it was scanning the number and adding
a 0 on the left and a 4 on the right of the number scanned so that an
eight digit number like:
00000009 became 00000000094
Now if you have a html form that limits the maximum size of inputed data
to say 8 digits in this example, your receiving PHP will get
00000000 as the number, which is the first 8 digits but isn't the number
you wanted.
Hence I made the maximum input size 2 digits larger and then wrote a
small bit of verification in there so that the numbers could be entered
with the barcode reader or by hand. If it detects the barcode reader is
being used, it chops the digit off each end and informs the user that it
thinks they're using the barcode reader.

PDF.... I don't have any experience of PHP and PDF together. I thought
it required a commercial library perhaps?

Hope it helps
Guy

--=20
Guy Edwards <guy_j_edwards@hotpop.com>