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

58 lines
975 B
PHP
Raw Permalink Normal View History

2023-03-07 11:25:14 +00:00
<?php
namespace fox\barcode;
use fox\barcode\lib\DatamatrixFactory;
class Datamatrix
{
public static function factory() {
return new DatamatrixFactory();
}
public static function html(
$code,
$size = null,
$margin = null,
$color = null
) {
$datamatrixFactory = self::factory()
->setCode($code)
->setSize($size)
->setMargin($margin)
->setColor($color)
->renderHTML();
}
public static function png(
$code,
$file = null,
$size = null,
$margin = null,
$color = null
) {
$datamatrixFactory = self::factory()
->setCode($code)
->setFile($file)
->setSize($size)
->setMargin($margin)
->setColor($color)
->renderPNG();
}
public static function svg(
$code,
$file = null,
$size = null,
$margin = null,
$color = null
) {
$datamatrixFactory = self::factory()
->setCode($code)
->setFile($file)
->setSize($size)
->setMargin($margin)
->setColor($color)
->renderSVG();
}
}