1<?php 2 3namespace jucksearm\barcode; 4 5use jucksearm\barcode\lib\DatamatrixFactory; 6 7class Datamatrix 8{ 9 public static function factory() { 10 return new DatamatrixFactory(); 11 } 12 13 public static function html( 14 $code, 15 $size = null, 16 $margin = null, 17 $color = null 18 ) { 19 $datamatrixFactory = self::factory() 20 ->setCode($code) 21 ->setSize($size) 22 ->setMargin($margin) 23 ->setColor($color) 24 ->renderHTML(); 25 } 26 27 public static function png( 28 $code, 29 $file = null, 30 $size = null, 31 $margin = null, 32 $color = null 33 ) { 34 $datamatrixFactory = self::factory() 35 ->setCode($code) 36 ->setFile($file) 37 ->setSize($size) 38 ->setMargin($margin) 39 ->setColor($color) 40 ->renderPNG(); 41 } 42 43 public static function svg( 44 $code, 45 $file = null, 46 $size = null, 47 $margin = null, 48 $color = null 49 ) { 50 $datamatrixFactory = self::factory() 51 ->setCode($code) 52 ->setFile($file) 53 ->setSize($size) 54 ->setMargin($margin) 55 ->setColor($color) 56 ->renderSVG(); 57 } 58}