I have some problem with zend barcode, i use laravel 5.7 and when i wrote a simple code from documentary (below)
use Zend\Barcode\Barcode;
$barcodeOptions = ['text' => 'ZEND-FRAMEWORK'];
$rendererOptions = [];
Barcode::render(
'code39',
'image',
$barcodeOptions,
$rendererOptions
);
This is part of my result:
�PNG IHDR>��h� pHYs���+IDATx����r� PO�����©c�9ISֺ2�@��Y֮eY��������#���=E���V��ܪ3~��_/�}�<��ϑ����푱�������]��>Ɂ��@Br !9��HH$$� Ɂ��@Br !9��HH$$� Ɂ��@Br !9��HH$$� Ɂ��@Br !9��HH$$� Ɂ��@Br !9��HH$$� Ɂ��@Br !9��HH$$�
looks like i have wrong charset but i don't know how fix it. I have server from digitalocean.
Your browser is receiving the PNG and being told it is a text file. You need to specify a MIME type. In this case, that MIME type would be image/png
.
For example:
return response()
->view('embedded')
->header('Content-Type', 'image/png');