Scodigo, Inc.

Log In | Register

Cart Items:
0

2D barcodes using SmartPill PHP

I found some open source php code for creating 2D barcodes (datamatrix barcodes) and am hoping some can help get it working with SmartPill and it's new container feature. I obviously don't have enough skill yet...

Anyone care to give a helping hand? This would help a great deal and would finally eliminate to the need to buy any other third part plug ins for FileMaker. SmartPill would completely free me!

AttachmentSize
Datamatrix Barcode.fp7508 KB
PHP 2D MATRIX Barcodes.fp7444 KB

Matrix 2D barcodes....example file that seems to work perfectly!

Hey Micah,

Thanks for you help. I have attached an example file that you can include with your normal ones if you like. I have tested all the standard characters and symbols and they all seem to scan fine with the PHP code. Great and thanks to your php code! This is a BIG help. No more fonts or other plugins for Barcodes!!!

2D barcodes using SmartPill PHP

Micah Woods's picture

Hello Bailey,

Try adding this to the end of the code:

$text = 'Hello World';
$type = 'png';
$size = 160;
if(!$size) $size = 160;

// strip non-supported chars (is this correct?)
$text = preg_replace('/[^\w!\"#$%&\'()*+,\-\.\/:;<=>?@[\\_\]\[{\|}~\r*]+ /','', $text);

// encode
$semacode = new Semacode();

$semacode->sendPNG($text,$size);

This is working here. I'd be curious to hear if the images that get created are indeed valid.

Regards,
Micah

Thanks.

It seems to work perfectly here also. I have to run a few tests to make sure that all scans well. Then I will eliminate some junk and clean up the code and you can have it back. With the linear barcode Code 128 and now this 2D barcode Datamatrix, I think people will be very happy. I know I am.

Thanks.