Scodigo, Inc.

Log In | Register

Cart Items:
0

Generating Barcodes in Containers

Hey Micah and others,

There was an example in your old file that create a barcode by writing to files, and uploading it to a container. I have modified it to use your new container functions. Hope someone else finds this useful. Thanks for all your help.

AttachmentSize
Barcode Example within container Field.fp7468 KB

Code 39 and EAN13?

Hi,

I find the code128 example just wonderful and wonder if there is any chance of helping me get the same function for code39 and ean13.
I've too much trouble to get it to work myself so I need some help.

Many thanks in advance.
Regards
David

EDIT: I managed to do it myself. I was about to attach a example file but can't seem to attach files (?)

New PHPx Barcode Function

Micah Woods's picture

Hello David,

I've had it on my list to add a PHPx barcode function, so your post prompted me to get this done. I've included support for Code39, Code128, EAN13, INT25, POSTNET and UPCA. You can download a new copy of the FunctionMaker file which now includes this barcode function:

http://www.scodigo.com/downloads/smartpill/apps/FunctionMaker.zip

If you're not familiar with PHPx, take a look at the SmartPill manual for more info. Also feel free to post back with questions or issues.

Regards,
Micah

Sweet, thanks, I'd like to

Sweet, thanks, I'd like to be able to set height and font size and so in for the barcodes. But I can't find the actual php-code for the function. I found the values for the barcodes but it seems to be encoded(?)
How and why is it like that?

Encoding

Micah Woods's picture

David,

PHPx uses an XML format and there can sometimes be an issue where the code you're trying to store includes illegal characters. My solution is to use PHP's base64_encode function to encode the code. You'll notice that base64_decode is then used to reverse the encoding:

eval(base64_decode($code));

I modified the code slightly but all of this is based on the PEAR Image_Barcode package:

http://pear.php.net/package/Image_Barcode

You can download the files there if you'd like or run base64_decode on the values stored in FunctionMaker and you'll be able to see the code. I'm pretty sure the classes for Code39 and EAN13 support font and height but it will take a bit of work to change the code around to support additional params.

Regards,
Micah

Thanks!

Micah Woods's picture

That's great Bailey, I'll add this to our examples.

Regards,
Micah