Installing Barcode Bakery

Program and extensions

The following programs and extensions must be installed:

  • PHP 7.4 or PHP 8+
  • GD Extension
  • BCMath (for PDF417, and Intelligent Mail only)

Download

You can find our software in our Download section. If you wish to download 2D barcodes or use our software for a commercial purposes, you must purchase a license.

Installing with Composer

All of our software can be loaded with Composer. The free non-commercial version is available on Packagist. If you purchase our library, you must download the required files from our server. Read how to make the composer.json further down.
Create a composer.json file and write the following:


{
    "require": {
        "barcode-bakery/barcode-common": ">=7",
        "barcode-bakery/barcode-1d": ">=7"
    }
}

In the console, type the following:


composer install

Create a file called test.php, then load the autoload.php file at the top of the file then start using our library.


<?php
require __DIR__ . '/vendor/autoload.php';

If you purchased our 1D version or other 2D libraries, they can be installed with Composer as such:


{
    "require": {
        "barcode-bakery/barcode-common-purchased": "*",
        "barcode-bakery/barcode-1d-purchased": "*",
        "barcode-bakery/barcode-qrcode": "*"
    },
    "repositories": [
        {
            "type": "path",
            "url": "..\\path-to-barcode-common\\barcode-common-purchased"
        },
        {
            "type": "path",
            "url": "..\\path-to-barcode-1d\\barcode-1d-purchased"
        },
        {
            "type": "path",
            "url": "..\\path-to-barcode-qrcode\\barcode-qrcode"
        }
    ]
}

Installing without Composer

If you do not use Composer, you can simply require each necessary file with a require_once method.
The manual will assume you have loaded the appropriate files.

Fonts

To add other fonts, simply copy .ttf fonts to the font folder.