/**
  * @test
  */
 public function png_barcode_generator_can_generate_code_128_barcode()
 {
     $generator = new Picqer\Barcode\BarcodeGeneratorPNG();
     $generated = $generator->getBarcode('081231723897', $generator::TYPE_CODE_128);
     $this->assertEquals('PNG', substr($generated, 1, 3));
 }
Пример #2
1
<?php

include 'src/BarcodeGenerator.php';
include 'src/BarcodeGeneratorPNG.php';
include 'src/BarcodeGeneratorSVG.php';
include 'src/BarcodeGeneratorHTML.php';
$generatorPNG = new Picqer\Barcode\BarcodeGeneratorPNG();
$generatorSVG = new Picqer\Barcode\BarcodeGeneratorSVG();
$generatorHTML = new Picqer\Barcode\BarcodeGeneratorHTML();
echo $generatorHTML->getBarcode('081231723897', $generatorPNG::TYPE_CODE_128);
echo $generatorSVG->getBarcode('081231723897', $generatorPNG::TYPE_EAN_13);
echo '<img src="data:image/png;base64,' . base64_encode($generatorPNG->getBarcode('081231723897', $generatorPNG::TYPE_CODE_128)) . '">';
Пример #3
0
 /**
  * Retorna o codigo de barras em formato image inline.
  *
  * @param XML $nfe
  * @return string
  */
 protected function getBarCode(XML $nfe)
 {
     $generator = new \Picqer\Barcode\BarcodeGeneratorPNG();
     $buffer = $generator->getBarcode($nfe->getChNFeTag('infEvento', 'ID')->value(), $generator::TYPE_CODE_128_C, 1, 40);
     return 'data:image/png;base64,' . base64_encode($buffer);
 }
Пример #4
0
<?php

/**
 *  Bar Code Generator 
 *
 */
header('Content-Type: image/png');
if (!hasCache($file)) {
    $obj = file_get_contents($file);
    $generator = new Picqer\Barcode\BarcodeGeneratorPNG();
    $content = $generator->getBarcode($obj, $generator::TYPE_CODE_128_A);
    generateCache($file, $content);
}
outputCache($file);
Пример #5
0
 /**
  * show barcode
  * これ使ってる?
  * URI : GET /?
  * @author hide
  * @return array
  */
 public function showBarcode()
 {
     $generator = new \Picqer\Barcode\BarcodeGeneratorPNG();
     return '<img src="data:image/png;base64,' . base64_encode($generator->getBarcode(Input::get('barcode-value'), $generator::TYPE_CODE_128)) . '">';
 }
Пример #6
-1
Route::get('/delete_item', function () {
    return view('delete_item');
});
Route::get('/teacher_registration_form', function () {
    return view('teacher_registration_form');
});
Route::get('/mail', function () {
    // 現状はわたすデータがないのでエンプティーアレイをわたします
    $data = [];
    Mail::send('emails.text', $data, function ($message) {
        $message->to('kutuzov1228@gmail.com', 'hide')->from('oicrental@gmail.com', 'oicrental')->subject('hidehide');
    });
});
Route::post('/bar', 'UserController@showBarcode');
Route::post('/barcode', function () {
    $generator = new \Picqer\Barcode\BarcodeGeneratorPNG();
    return '<img src="data:image/png;base64,' . base64_encode($generator->getBarcode(Input::get('barcode-value'), $generator::TYPE_CODE_128)) . '">';
});
Route::get('/index', function () {
    return view('/index');
});
Route::get('/error', function () {
    return view('/error');
});
Route::get('/teacher_email_change', function () {
    return view('/teacher_email_change');
});
Route::get('/student_registration_form', 'UserController@showStudentForm');
Route::post('/student_registration', 'UserController@storeStudent');
Route::get('/item_list', 'UserController@showItemList');
Route::get('/item_registration_form', 'UserController@showItem');