[[PHPめも]] PHPで1次元のバーコードを生成します。 使用するツールは [[PHP Barcode Generator:https://github.com/picqer/php-barcode-generator]] です。 PEARでは [[Image_Barcode2:https://pear.php.net/package/Image_Barcode2]] があります。 <?php require_once 'vendor/autoload.php'; $generator = new Picqer\Barcode\BarcodeGeneratorHTML(); /** * @param string $code code to print * @param string $type type of barcode * @param int $widthFactor Width of a single bar element in pixels. * @param int $totalHeight Height of a single bar element in pixels. * @param int|string $color Foreground color for bar elements (background is transparent). */ echo $generator->getBarcode('081231723897', $generator::TYPE_EAN_13, 2, 30, 'black'); *バーコードの種類を調べる [#k75c0611] バーコードの実物はあるけど使用されている種類がわからないという場合は以下のアプリで判別できました。~ [[バーコードスキャナのプロ:https://play.google.com/store/apps/details?id=com.geekslab.qrbarcodescanner.pro&hl=ja]]