Overview #

The Barcode package allows you to create various type of barcodes and qrcodes in multiple format like jpg, png and svg.

Installation #

By downloading .zip file #

  1. Download zip file from My Licenses
  2. Unzip
  3. Copy the folder barcode into koolreport folder, it will look like below:
├── core
├── barcode

By composer #

If you have purchased the package then you can follow these steps to install

  1. Login to
  2. Go to My Licenses
  3. Click Get Token For Composer button
  4. Copy the text and save to file auth.json next to composer.json
  5. Add the repositories to composer.json like below
  6. Run composer update to install package



Your auth.json will look like this:

    "http-basic": {
        "": {
            "username": "",
            "password": "your-secret-token"

Note: Please add your auth.json to .gitignore as it contains your secret login information.

Quickstart #

In your view, you could use the BarCode and QRCode widgets like following:

  use \koolreport\barcode\BarCode;
  use \koolreport\barcode\QRCode;
    "format" => "html", //"svg", "png", "jpg"
    "value" => "081231723897",
    "type" => "TYPE_CODE_128",
    "widthFactor" => 2,
    "height" => 30,
    "color" => "black", //"{{color string}}" for html and svg, array(R, G, B) for jpg and png


    "format" => "svg", //"png", "jpg"
    "value" => "Test QRCode",
    "size" => 150,
    "foregroundColor" => array(0, 0, 0),
    "backgroundColor" => array(255, 255, 255),

BarCode #

Properties #

formatstring"jpg"This property defines the output format of barcodes. We have 4 formats: html (using divs and background color), svg (vector image), jpg and png.
valuestring""This is the value of barcode
typestring"TYPE_CODE_128"This property is for various types of barcode. List of support barcode type is below.
widthFactornumber"2px"This is the width of each bar in pixel
heightnumber30This set the height of barcodes.
colorstring/arrayA color string for html and svg formats; an array of (r, g, b) values for jpg and png formats.

List of types #

Supported types of BarCodes

QRCode #

Properties #

formatstring"jpg"This property defines the output format of qrcodes. We have 3 formats: svg, jpg and png.
valuestring""This is the value of qrcode.
sizenumber150Set the size in px of qrcodes.
foregroundColorarrayarray(0,0,0)An array of (r, g, b) values for the foreground color of qrcodes.
backgroundColorarrayarray(255, 255, 255)An array of (r, g, b) values for the background color of qrcodes.

Get started with KoolReport

KoolReport will help you to construct good php data report by gathering your data from multiple sources, transforming them into valuable insights, and finally visualizing them in stunning charts and graphs.