I'm creating a registration system when an applicant register the system will automatically create a barcode for the applicant and save it to the folder "Barcode".
I'm using barcodePHP
My problem is I dont know how to save it to a folder, getting the saved location for using echo to display the barcode and renaming the barcode picture.
This is my code:
require('class/BCGColor.php');
require('class/BCGDrawing.php');
require('class/BCGcode39.barcode.php');
$color_black = new BCGColor(0, 0, 0);
$color_white = new BCGColor(255, 255, 255);
// Barcode Part
$code = new BCGcode39();
$code->setScale(2);
$code->setThickness(30);
$code->setForegroundColor($color_black);
$code->setBackgroundColor($color_white);
$code->setFont($font);
$code->setChecksum(false);
$code->parse($encoded);
// Drawing Part
$drawing = new BCGDrawing('', $color_white);
$drawing->setBarcode($code);
$drawing->draw();
$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);