csanpedro
04-03-2008, 08:41 PM
Hi i cannot use my 3of9 barcode generator script to print employee id-code here at free-space.
<?php
//set the content type this page returns
header('Content-type: image/png');
//set values
$size = 35;
$width = 300;
$height = $size;
$id = $_REQUEST['txtEmployee'];
//align the barcode at the bottom and one pixel from the left
$startlocation_y = $height;
$startlocation_x = 1;
//create and image of the correct size
$im = imagecreate($width,$height);
//add the black and white colours to the image
$white = imagecolorallocate($im,255,255,255);
$black = imagecolorallocate($im,0,0,0);
$font = '3OF9.TTF';
$text = $id;
//write the barcode text to the image using the “3 of 9”
//barcode font which must be in the same directory.
//The $black colour is negated to remove anti-aliasing.
//The 0 indicates the angle of the text.
imagettftext($im, $size, 0, $startlocation_x, $startlocation_y, -$black, $font, $text);
//return the image and release resources
imagepng($im);
imagedestroy($im);
?>
<?php
//set the content type this page returns
header('Content-type: image/png');
//set values
$size = 35;
$width = 300;
$height = $size;
$id = $_REQUEST['txtEmployee'];
//align the barcode at the bottom and one pixel from the left
$startlocation_y = $height;
$startlocation_x = 1;
//create and image of the correct size
$im = imagecreate($width,$height);
//add the black and white colours to the image
$white = imagecolorallocate($im,255,255,255);
$black = imagecolorallocate($im,0,0,0);
$font = '3OF9.TTF';
$text = $id;
//write the barcode text to the image using the “3 of 9”
//barcode font which must be in the same directory.
//The $black colour is negated to remove anti-aliasing.
//The 0 indicates the angle of the text.
imagettftext($im, $size, 0, $startlocation_x, $startlocation_y, -$black, $font, $text);
//return the image and release resources
imagepng($im);
imagedestroy($im);
?>