Generate ean13 barcode and save it to png
<p>I am using <code>Kody kreskowe - EAN-13</code> by Jacek Kowalski (<a href="http://jacekk.info" rel="nofollow">http://jacekk.info</a>) to generate EAN13 barcode and save it to image file. I would like generate barcode dynamically during the ordering process in Prestashop. Save that image on server and put it in new_order.html email template.</p>

<p>There is whole code: <a href="https://jacekk.info/skrypty/ean13.phps" rel="nofollow">https://jacekk.info/skrypty/ean13.phps</a></p>

<p>I modified it lightly by change <code>$_GET['kod']</code> to <code>$kod_in</code> and put <code>$kod_in = 1234567891011</code> at start of file and <code>imagepng($i, $new_filename);</code> at the end</p>

<p>Everything works well (I see generated barcode and script create new image file and save it on server) when I enter directly to file ean13.php or if I run that code (directly in web browser):</p>

<pre><code>$kod_in = 1234567891011;
include (dirname(__FILE__)."/ean13.php");
</code></pre>

<p>But when I try include the above code into order process, exactly in mailalerts.php, it does not display barcode and generate blank (white) image file. I think it has something to do with the fact that the generated barcode is not displayed on the screen, and then is saved. </p>

<p>Please help modify the code to generate the images even though they are not displayed on the screen.</p>