PHP code example of thalassa-web / barcode-helper

1. Go to this page and download the library: Download thalassa-web/barcode-helper 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/ */

    

thalassa-web / barcode-helper example snippets


use ThalassaWeb\BarcodeHelper\BarcodeHelper;
use ThalassaWeb\BarcodeHelper\EnumBarcode;

$code93Bin = BarcodeHelper::getBarcode(EnumBarcode::CODE_93_BIN);
$code93Font = BarcodeHelper::getBarcode(EnumBarcode::CODE_93_FONT);

// Encodage à destination d'une police de caractères
echo $code93Font->encoder("/PT/12AZERTY34");

// Encodage à destination de la police générique
echo $code93Bin->encoder('/PT/12AZERTY34');

// Obtention de la clé de contrôle
echo $code93Bin->getChecksum('/PT/12AZERTY34');

// Validation des données
echo $code93Bin->valider('/PT/12AZERTY34');

// Le code 93 n'autorise pas les soulignées «_»
echo $code93Bin->valider('/PT/12AZE_RTY34');

echo BarcodeHelper::getBarcode(EnumBarcode::CODE_93_FONT)->encoder("/PT/12AZE_RTY34"); 

echo BarcodeHelper::getBarcode(EnumBarcode::EAN_13_FONT)->encoder("123456789012"); 

echo BarcodeHelper::getBarcode(EnumBarcode::CODE_128_FONT)->encoder("/PT/12AZE_RTY34"); 

echo BarcodeHelper::getBarcode(EnumBarcode::EAN_13_BIN)->encoder("123456789012"); 
echo BarcodeHelper::getBarcode(EnumBarcode::CODE_93_BIN)->encoder("/PT/12AZERTY34");
echo BarcodeHelper::getBarcode(EnumBarcode::CODE_128_BIN)->encoder("/PT/12AZE_RTY34");