PHP code example of chenbool / barcode

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

    

chenbool / barcode example snippets



\chenbool\Code\Barcode;

// 生成 Code39 条形码
Barcode::code39('text to encode');


use \chenbool\Code\Barcode;

// 设置高度为 80,宽度比例为 2
Barcode::code39('text to encode', 80, 2);

Barcode::code39($text, $height = 50, $widthScale = 1)

barcode/
├── src/                    # 源代码
│   └── barcode.php        # 条形码生成类
├── index.php              # 示例文件
├── composer.json          # 依赖配置
└── README.md