1. Go to this page and download the library: Download tanvirismail/barcode library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tanvirismail / barcode example snippets
use TanvirIsmail\Barcode\Barcode;
$barcode = new Barcode;
$barcode->code('200300001');
$barcode->type('code39'); // code39, code128
$barcode->height(100);
$barcode->barWidth(2);
$barcode->margin(10);
$barcode->background([255, 255, 255]); // transparent = [0, 0, 0, 127]
$barcode->barColor([[0, 0, 0],[255, 255, 255]]);
$barcode->showcode();
$barcode->label('barcode');
$barcode->labelPosition('right'); // center , left, right
$barcode->responseHeader();
echo $barcode->build();
// for laravel
response($barcode->build())->header('Content-Type', $barcode->getContentType());
$barcode->extension('png'); // jpeg, png
$barcode->path('barcode.png'); // path with file name
$barcode->save();
$barcode->download();
// if download as file name
$barcode->extension('png'); // default 'png'
$barcode->download('test'); // file name without extention
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.