1. Import

This commit is contained in:
2026-03-29 10:34:57 +02:00
parent b0e00c1259
commit a1129565af
4899 changed files with 3007593 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
<?php
include_once ("../../include/mcglobal.inc.php");
// Check HTTP-Parameters
getSecHttpVars("1",array("text"));
require 'autoload.php';
use BarcodeBakery\Common\BCGColor;
use BarcodeBakery\Common\BCGDrawing;
use BarcodeBakery\Common\BCGFontFile;
use BarcodeBakery\Barcode\BCGcode39;
// Loading Font
$font = new BCGFontFile('Arial.ttf', 18);
// The arguments are R, G, B for color.
$colorBlack = new BCGColor(0, 0, 0);
$colorWhite = new BCGColor(255, 255, 255);
$drawException = null;
$barcode = null;
try {
$code = new BCGcode39();
// Uncomment when using the commercial version
////$code->useCommercialVersion();
$code->setScale(2); // Resolution
$code->setThickness(30); // Thickness
$code->setForegroundColor($colorBlack); // Color of bars
$code->setBackgroundColor($colorWhite); // Color of spaces
$code->setFont($font); // Font (or 0)
$code->setChecksum(false);
$code->parse($text); // Text
$barcode = $code;
} catch (Exception $exception) {
$drawException = $exception;
}
$drawing = new BCGDrawing($barcode, $colorWhite);
if ($drawException) {
$drawing->drawException($drawException);
}
// Header that says it is an image (remove it if you save the barcode to a file)
header('Content-Type: image/png');
header('Content-Disposition: inline; filename="barcode.png"');
// Draw (or save) the image into PNG format.
$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);