I would like to render multiple Zend Framework 2 barcodes on a page.
I have been following this example (although it is for ZF1) Zend Framework Render Barcodes Into PDF Pages
I am currently using DOMPDFModule
to create a pdf.
How do I display the barcode using ZF2? How can I render them in the view?
// Only the text to draw is required
$barcodeOptions = array('text' => 'ZEND-FRAMEWORK');
// No required options
$rendererOptions = array(
'imageType' => 'gif'
);
// Draw the barcode in a new image,
$imageResource = Barcode::factory(
'code39', 'image', $barcodeOptions, $rendererOptions
)->draw();
When I var_dump $imageResource
I get:
"resource(459) of type (gd)"
When I use imagegd()
I get a bunch of symbols.
Not sure I am going down the best path.
In the end I would like to run through a foreach
to get an image of each barcode which I can add to a pdf.