1

Zend \ Barcode 네임 스페이스를 사용하여 여러 개의 바코드를 인쇄하려고합니다.Zend 2로 여러 바코드를 렌더링하는 방법은 무엇입니까?

문제는 읽는 중입니다. manual 하나 이상의 바코드를 인쇄 할 수 없습니다.

바코드 앞에 에코도 인쇄 할 수 없습니다.

여러 바코드와 텍스트를 함께 인쇄하려면 어떻게해야합니까?

내가 사용하는 코드는이 하나와 유사한 :

use Zend\Barcode\Barcode; 

$barcodeOptions = array('text' => '123456'); 
$rendererOptions = array(); 

Barcode::render(
    'code39', 'image', $barcodeOptions, $rendererOptions 
); 

$barcodeOptions = array('text' => '654321'); 
Barcode::render(
    'code39', 'image', $barcodeOptions, $rendererOptions 
); 

답변

4

Barcode::render() 그것에 이미지 이미지가 아닌 HTML 페이지를 생성합니다. 당신이 뭔가를 할 필요가 있습니다 :

barcode.php :

use Zend\Barcode\Barcode; 
$barcodeOptions = array('text' => $_GET['code']); 
$rendererOptions = array(); 
Barcode::render(
    'code39', 'image', $barcodeOptions, $rendererOptions 
); 

그리고 이미지 것처럼 다음 HTML에서, 해당 스크립트를 참조 :

<img src="http://domain.com/barcode.php?code=123456" /> 
<img src="http://domain.com/barcode.php?code=654321" /> 
+0

이 작품 좋아. 그러나 이미지를 직접 에코 할 수는 없습니까? – GarouDan

+0

당신이 이렇게하는 경우에만 : http://stackoverflow.com/questions/1207190/embedding-base64-images –

+0

나는 그것이 나에게 범위를 벗어난 것 같아요. 정말 고마워. 수락 됨 =) – GarouDan

관련 문제