PHP code example of sqkhor / publication-barcode

1. Go to this page and download the library: Download sqkhor/publication-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/ */

    

sqkhor / publication-barcode example snippets


use \SQKhor\Barcode\PublicationBarcode;

// ISBN
$barcode = new PublicationBarcode('978-967-2088-62-2');
$svg = $barcode->render('svg');

// ISBN with add on
$barcode = new PublicationBarcode('978-967-2088-62-2', '50999');
$png = $barcode->render('svg');

// ISSN with issue number
$barcode = new PublicationBarcode('3009-1004', '01');
$svg = $barcode->svg();

$barcode = new PublicationBarcode('978-967-2088-62-2');
$svg = $barcode->svg();
$png = $barcode->png();
$jpg = $barcode->jpg();