本文整理匯總了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) {