$phpWord->addParagraphStyle('loc1', array('spaceBefore' => 150, 'lineHeight' => 1.0, 'spaceAfter' => 0, 'align' => 'left', 'keepNext' => true, 'keepLines' => true));
$phpWord->addFontStyle('countrystateFont', array('size' => 11, 'bold' => true, 'name' => 'Arial'));
$phpWord->addFontStyle('localityFont', array('size' => 11, 'name' => 'Arial'));
$phpWord->addParagraphStyle('other', array('align' => 'left', 'lineHeight' => 1.0, 'spaceAfter' => 0, 'keepNext' => true, 'keepLines' => true));
$phpWord->addFontStyle('otherFont', array('size' => 10, 'name' => 'Arial'));
$phpWord->addFontStyle('associatedtaxaFont', array('size' => 10, 'italic' => true, 'name' => 'Arial'));
$phpWord->addParagraphStyle('collector', array('spaceBefore' => 150, 'lineHeight' => 1.0, 'spaceAfter' => 0, 'align' => 'left', 'keepNext' => true, 'keepLines' => true));
$phpWord->addParagraphStyle('cnbarcode', array('align' => 'center', 'lineHeight' => 1.0, 'spaceAfter' => 0, 'spaceBefore' => 150, 'keepNext' => true, 'keepLines' => true));
$phpWord->addParagraphStyle('lfooter', array('align' => 'center', 'lineHeight' => 1.0, 'spaceAfter' => 0, 'spaceBefore' => 150, 'keepNext' => true, 'keepLines' => true));
$phpWord->addFontStyle('lfooterFont', array('bold' => true, 'size' => 12, 'name' => 'Arial'));
$section = $phpWord->addSection($sectionStyle);
foreach ($labelArr as $occid => $occArr) {
    if ($barcodeOnly) {
        if ($occArr['catalognumber']) {
            $textrun = $section->addTextRun('cnbarcode');
            $bc = $bcObj->draw(strtoupper($occArr['catalognumber']), "Code39", "png", false, 40);
            imagepng($bc, $serverRoot . '/temp/report/' . $ses_id . $occArr['catalognumber'] . '.png');
            $textrun->addImage($serverRoot . '/temp/report/' . $ses_id . $occArr['catalognumber'] . '.png', array('align' => 'center'));
            imagedestroy($bc);
        }
    } else {
        $midStr = '';
        if ($hMid == 1) {
            $midStr = $occArr['country'];
        } elseif ($hMid == 2) {
            $midStr = $occArr['stateprovince'];
        } elseif ($hMid == 3) {
            $midStr = $occArr['county'];
        } elseif ($hMid == 4) {
            $midStr = $occArr['family'];
        }
 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;
 }
Exemple #3
0
<?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);
Exemple #4
0
 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);
    }
}
Exemple #6
0
 function barras($carnet)
 {
     error_reporting(0);
     require_once 'Image/Barcode.php';
     Image_Barcode::draw($carnet, 'code128', 'png');
 }
Exemple #7
0
 public static function generateBarcode($text)
 {
     require_once 'PEAR/Image/Barcode.php';
     Image_Barcode::draw($text, 'Code39', 'png');
 }
Exemple #8
0
<?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);