<?php include_once '../../config/symbini.php'; include_once $serverRoot . '/classes/OccurrenceLabel.php'; @(include_once "Image/Barcode.php"); @(include_once "Image/Barcode2.php"); require_once $serverRoot . '/classes/PhpWord/Autoloader.php'; header("Content-Type: text/html; charset=" . $charset); ini_set('max_execution_time', 180); //180 seconds = 3 minutes $ses_id = session_id(); if (class_exists('Image_Barcode2')) { $bcObj = new Image_Barcode2(); } elseif (class_exists('Image_Barcode')) { $bcObj = new Image_Barcode(); } $labelManager = new OccurrenceLabel(); use PhpOffice\PhpWord\Autoloader; use PhpOffice\PhpWord\Settings; Autoloader::register(); Settings::loadConfig(); $collid = $_POST["collid"]; $hPrefix = $_POST['lhprefix']; $hMid = $_POST['lhmid']; $hSuffix = $_POST['lhsuffix']; $lFooter = $_POST['lfooter']; $occIdArr = $_POST['occid']; $rowsPerPage = $_POST['rpp']; $speciesAuthors = array_key_exists('speciesauthors', $_POST) && $_POST['speciesauthors'] ? 1 : 0; $showcatalognumbers = array_key_exists('catalognumbers', $_POST) && $_POST['catalognumbers'] ? 1 : 0; $useBarcode = array_key_exists('bc', $_POST) ? $_POST['bc'] : 0;
function create($p_code, $p_type, $p_ext) { require_once GLPI_ROOT . '/plugins/barcode/lib/Image_Barcode/Barcode.php'; require_once GLPI_ROOT . '/plugins/barcode/inc/functions_debug.php'; //TODO : filtre sur le type if (!file_exists($this->docsPath . $p_code . '_' . $p_type . '.' . $p_ext)) { plugin_barcode_disableDebug(); ob_start(); $barcode = new Image_Barcode(); $resImg = imagepng($barcode->draw($p_code, $p_type, $p_ext, false)); $img = ob_get_contents(); ob_end_clean(); plugin_barcode_reenableusemode(); file_put_contents($this->docsPath . $p_code . '_' . $p_type . '.' . $p_ext, $img); if (!$resImg) { return false; } } return true; }
<?php require_once "Barcode.php"; $num = isset($_REQUEST['num']) ? $_REQUEST['num'] : '1-3-1'; $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : 'code128'; $imgtype = isset($_REQUEST['imgtype']) ? $_REQUEST['imgtype'] : 'png'; Image_Barcode::draw($num, $type, $imgtype);
static function writeBarCodeFile($file_name, $num, $print_text = TRUE, $height = 60) { if (!class_exists('Image_Barcode')) { require_once Environment::getBasePath() . '/classes/Image_Barcode/Barcode.php'; } ob_start(); $ib = new Image_Barcode(); $ib->draw($num, 'code128', 'png', FALSE, $print_text, $height); $ob_contents = ob_get_contents(); ob_end_clean(); if (file_put_contents($file_name, $ob_contents) > 0) { //echo "Writing file successfull<Br>\n"; return TRUE; } else { //echo "Error writing file<Br>\n"; return FALSE; } }
<?php error_reporting(0); include_once '../../config/symbini.php'; @(include_once "Image/Barcode.php"); @(include_once "Image/Barcode2.php"); header("Content-type: image/png"); $bcText = array_key_exists('bctext', $_REQUEST) ? $_REQUEST["bctext"] : ''; $bcCode = array_key_exists('bccode', $_REQUEST) ? $_REQUEST['bccode'] : 'Code39'; $imgType = array_key_exists('imgtype', $_REQUEST) ? $_REQUEST['imgtype'] : 'png'; $bcHeight = array_key_exists('bcheight', $_REQUEST) ? $_REQUEST['bcheight'] : 50; if ($bcText) { if (class_exists('Image_Barcode2')) { $bcText = strtoupper($bcText); $bcObj = new Image_Barcode2(); $bc = $bcObj->draw($bcText, "Code39", "png", false, $bcHeight); imagepng($bc); imagedestroy($bc); } elseif (class_exists('Image_Barcode')) { $bcText = strtoupper($bcText); $bcObj = new Image_Barcode(); $bc = $bcObj->draw($bcText, "Code39", "png"); imagepng($bc); imagedestroy($bc); } }
function barras($carnet) { error_reporting(0); require_once 'Image/Barcode.php'; Image_Barcode::draw($carnet, 'code128', 'png'); }
public static function generateBarcode($text) { require_once 'PEAR/Image/Barcode.php'; Image_Barcode::draw($text, 'Code39', 'png'); }
<?php require_once "Image/Barcode.php"; // chamada para a biblioteca Image_Barcode // O parâmetro deve ser passado via GET // se for passado via POST não será possível // salvar o código gerado como .PNG $cod = $_GET['codBarra']; $type = "code128"; Image_Barcode::draw($cod, $type);