PHP code example of tobiascapin / php-barcode

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

    

tobiascapin / php-barcode example snippets


use jucksearm\barcode\Barcode;

Barcode::html('https://github.com/jucksearm/php-barcode', 'C128');

use jucksearm\barcode\Barcode;

Barcode::factory()
  ->setCode('https://github.com/jucksearm/php-barcode')
  ->setType('C128')
  ->setScale(null)
  ->setHeight(null)
  ->setRotate(null)
  ->setColor(null)
  ->renderHTML();

Barcode::html($code, $type, $scale = null, $height = null, $rotate = null, $color = null)

Barcode::png($code, $type, $file= null, $scale = null, $height = null, $rotate = null, $color = null)

Barcode::svg($code, $type, $file= null, $scale = null, $height = null, $rotate = null, $color = null)

$type    C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, EAN2, EAN5, EAN8, EAN13, UPCA, UPCE, MSI, MSI+, POSTNET, PLANET, RMS4CC, KIX, IMB, CODABAR, CODE11, PHARMA, PHARMA2T
$file    Barcode save filename [default: `null`]
$scale   Barcode unit size in `px` units [default: `1`]
$height  Barcode height in `px` units [default: `30`]
$rotate  Support 0, 90 in `degrees` units [default: `0`]
$color   Support in `hexadecimal` color units [default: `000`]

QRcode::html($code, $emblem = null, $level = null, $size = null, $margin = null, $color = null)

QRcode::png($code, $emblem = null, $file = null, $level = null, $size = null, $margin = null, $color = null)

QRcode::svg($code, $emblem = null, $file = null, $level = null, $size = null, $margin = null, $color = null)

$emblem  Insert mask Logo [default: `null`]
$file    QRcode save filename [default: `null`]
$level   QRcode level L,M,Q,H [default: `L`]
$size    QRcode width and height size in `px` units [default: `100`]
$margin  QRcode empty space in `percentage` units [default: `1`]
$color   Support in `hexadecimal` color units [default: `000`]

Datamatrix::html($code, $size = null, $margin = null, $color = null)

Datamatrix::png($code, $file = null, $size = null, $margin = null, $color = null)

Datamatrix::svg($code, $file = null, $size = null, $margin = null, $color = null)

$file    Datamatrix save filename [default: `null`]
$size    Datamatrix width and height size in `px` units [default: `100`]
$margin  Datamatrix empty space in `percentage` units [default: `1`]
$color   Support in `hexadecimal` color units [default: `000`]

PDF417::html($code, $size = null, $margin = null, $color = null)

PDF417::png($code, $file = null, $size = null, $margin = null, $color = null)

PDF417::svg($code, $file = null, $size = null, $margin = null, $color = null)

$file    PDF417 save filename [default: `null`]
$size    PDF417 width and height size in `px` units [default: `100`]
$margin  PDF417 empty space in `percentage` units [default: `1`]
$color   Support in `hexadecimal` color units [default: `000`]

composer