chimera-mark2-core-release/core/fox/barcode/Barcode.php

70 lines
1.2 KiB
PHP
Raw Normal View History

2023-03-07 11:25:14 +00:00
<?php
namespace fox\barcode;
use fox\barcode\lib\BarcodeFactory;
class Barcode
{
public static function factory() {
return new BarcodeFactory();
}
public static function html(
$code,
$type,
$scale = null,
$height = null,
$rotate = null,
$color = null
) {
$barcodeFactory = self::factory()
->setCode($code)
->setType($type)
->setScale($scale)
->setHeight($height)
->setRotate($rotate)
->setColor($color)
->renderHTML();
}
public static function png(
$code,
$type,
$file = null,
$scale = null,
$height = null,
$rotate = null,
$color = null
) {
$barcodeFactory = self::factory()
->setCode($code)
->setType($type)
->setFile($file)
->setScale($scale)
->setHeight($height)
->setRotate($rotate)
->setColor($color)
->renderPNG();
}
public static function svg(
$code,
$type,
$file = null,
$scale = null,
$height = null,
$rotate = null,
$color = null
) {
$barcodeFactory = self::factory()
->setCode($code)
->setType($type)
->setFile($file)
->setScale($scale)
->setHeight($height)
->setRotate($rotate)
->setColor($color)
->renderSVG();
}
}