Barcode Reading

Warning: This post is for the ultra technogeek.  It is our (small) contribution back to the open source community, which has provided Treasure Coast Film with so much!

With all of the documents we process in a day’s time it is an absolute necessity that we find ways to efficiently manage document processing.  Order Forms, reviews, surveys, payment vouchers, estimate authorizations, and other forms would take an indefinitely long time to handle if we didn’t use bar-codes.  In another post we will discuss how we decode the bar-codes.

For generating the bar-codes we use the PEAR class of PHP named Image_Barcode2, which lacks good documentation.  Here is our attempt to show how to use the class.

We started with this post.

If you need to install the class:

pear install Image_Barcode2  (from the linux command line)

Code (which we rotate the image 90 degrees and place it toward the lower right hand bottom of the image.

<?php

function str2barcodeBase64($str) {
include_once “Image/Barcode2.php”;

$str = empty($str) ? ‘test’ : $str;
$type = ‘code128’;  //See more below
$imgtype = ‘png’;
$bSendToBrowser = FALSE;
$height = 20;
$width = 1;

$img = Image_Barcode2::draw($str, $type, $imgtype, $bSendToBrowser, $height, $

ob_start();
imagepng($img);
$imgBase64 = base64_encode(ob_get_contents());
ob_end_clean();

imagedestroy($img);

$return = ‘<img src=”data:image/’ . $imgtype . ‘;base64,’ . $imgBase64 . ‘”>’;
return $return;
}

$str = “member1001000”;
$str = “pink0125”;

print “<div style=\”float:right; margin-top: 450px; -webkit-transform:rotate(90deg);width:20px\”>\n”;

print str2barcodeBase64($str);

print “</div>\n”;

?>

Above you will see the variable $types.  you can change it to any of these:

Barcode Types:

int25

ean13

ean8

Code39

upca

upce

code128

postnet

The Movie Database

Warning: This post is for the ultra technogeek.  It is our (small) contribution back to the open source community, which has provided Treasure Coast Film with so much!

At Treasure Coast Film we figure its obvious that we love old movies!  When you look at the list of our old movies (by clicking here) you will see that its extremely obvious we love old movies!  We love them so much that we made a webpage for them and even make a Twitter Post for one each and every day!

Continue reading