本文整理汇总了PHP中Zend\Barcode\Barcode::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Barcode::render方法的具体用法?PHP Barcode::render怎么用?PHP Barcode::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Barcode\Barcode
的用法示例。
在下文中一共展示了Barcode::render方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: barcode
public function barcode($code, $type = 'code128')
{
if (!in_array($type, ['code128', 'code25', 'code25interleaved', 'code39', 'ean13', 'ean2', 'ean5', 'ean8', 'identcode', 'itf14', 'leitcode', 'planet', 'postnet', 'royalmail', 'upca', 'upce'])) {
\App::abort(404);
}
//Barcode::setBarcodeFont( storage_path( 'pdf/fonts/yahei/normal.ttf' ) );
$barcodeOptions = array('text' => $code, 'factor' => 1);
$rendererOptions = array();
Barcode::render($type, 'image', $barcodeOptions, $rendererOptions);
$response = \Response::make('', 200);
$response->header('Content-Type', 'image/png', true);
return $response;
}
示例2: DrawBarcode
/**
* This draws and optionally renders a barcode image
*
* @param string $strText The text to represent as a barcode
* @param bool $blnRender
* @return image
*/
public static function DrawBarcode($strText, $blnRender = false)
{
$arrBarcodeOptions = array('text' => $strText, 'font' => __INCLUDES__ . '/fonts/VeraMono.ttf');
// No required renderer options
$arrRendererOptions = array();
if (!$blnRender) {
// Draw the barcode and return the resource
$imgResource = Barcode::draw('code128', 'image', $arrBarcodeOptions, $arrRendererOptions);
return $imgResource;
} else {
// Draw the barcode in a new image,
// send the headers and the image
Barcode::render('code128', 'image', $arrBarcodeOptions, $arrRendererOptions);
}
}
示例3:
$key = 'seatId_' . $seatId;
//tmp key
$tmpArray->{$key} = $dtcmBarcode;
$zoneSeatsObj->setBarcode($dtcmBarcode);
$em->persist($zoneSeatsObj);
$em->flush();
}
}
$update = TRUE;
} else {
$dtcmError = TRUE;
}
}
}
//if dtcm error
if ($dtcmError) {