Re: Use Image/Barcode
| From: | Richard Quadling | Date: | Tue, 22 Mar 2011 15:13:52 +0000 |
| Subject: | Re: Use Image/Barcode | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-31036@lists.php.net to get a copy of this message | ||
On 22 March 2011 15:06, Richard Quadling <rquadling@gmail.com> wrote:
> On 22 March 2011 14:16, Alejandro Crosa <alecros@ymail.com> wrote:
>> Hi
>> I need to know how to do for add the output of Image_barcode()...draw().. to a
>> file.
>>
>> Thanks
>>
>> Best regards
>>
>> Alejandro
>>
>>
>>
>
> The output of the draw method is a gd object.
>
> So, http://uk.php.net/manual/en/function.imagepng.php could be
> used.
>
> imagepng($bc->draw('123abc'), '/images/barcode_123abc.png');
>
> for example.
>
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>
Slight update.
By default, the draw() method wants to write the file out.
http://pear.php.net/package/Image_Barcode/docs/latest/Image_Barcode/Image_Barcode.html#methoddraw
shows that you must pass false as param #4.
imagepng($bc->draw($data, $type, 'png', false), '/images/barcode.png');
I think may be right.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY