gowri Posted November 20, 2013 Share Posted November 20, 2013 hello, How to write a dynamic barcode in pdf invoice header at right top corner in prestashop1.5? Please tell me the solution Thanks in Advance Link to comment Share on other sites More sharing options...
tuk66 Posted November 22, 2013 Share Posted November 22, 2013 You need barcode fonts installed. I can only mention the M4 PDF Extensions module which can easily use many barcode fonts and there are already many examples in templates using barcodes. Link to comment Share on other sites More sharing options...
tuk66 Posted December 17, 2013 Share Posted December 17, 2013 PrestaShop uses the TCPDF library to generate PDF invoices. Barcodes are basically like other text but printed through a "barcode" font, not letters. That is all. Link to comment Share on other sites More sharing options...
johnsalimie Posted August 13, 2014 Share Posted August 13, 2014 hi PrestaShop uses the TCPDF library to generate PDF invoices. Barcodes are basically like other text but printed through a "barcode" font, not letters. That is all. i bought the module, its working but it generating an extra digit and also a ">" behind every barcode. and i cant scan it properly. how do it solve it thanks Link to comment Share on other sites More sharing options...
tuk66 Posted August 18, 2014 Share Posted August 18, 2014 What module? Link to comment Share on other sites More sharing options...
cikcak Posted March 27, 2015 Share Posted March 27, 2015 PrestaShop uses the TCPDF library to generate PDF invoices. Barcodes are basically like other text but printed through a "barcode" font, not letters. That is all. Hey, im trying to show barcode at invoice footer but got this result: http://prntscr.com/6lwpfv $barcodeobj = new TCPDFBarcode('http://www.myshop.eu' 'C128'); $barcod = $barcodeobj->getBarcodeHTML(2, 30, 'black'); and assign barcod to variables in HTMLTemplate.php getFooter function. What Did I do wrong? Thanks man! Link to comment Share on other sites More sharing options...
tuk66 Posted March 27, 2015 Share Posted March 27, 2015 Missing comma? $barcodeobj = new TCPDFBarcode('http://www.myshop.eu', 'C128'); Link to comment Share on other sites More sharing options...
cikcak Posted March 27, 2015 Share Posted March 27, 2015 (edited) Missing comma? $barcodeobj = new TCPDFBarcode('http://www.myshop.eu', 'C128'); Sorry, using this: $barcodeobj = new TCPDFBarcode("http://www.myshop.eu" , "C128"); $barcod = $barcodeobj->getBarcodeHTML(2, 30, "black"); But got same effect. Edited March 27, 2015 by cikcak (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted March 27, 2015 Share Posted March 27, 2015 Sorry, I never used TCPDFBarcode class. I have simple <barcode> tags in my templates, but those don't use TCPDF library. Link to comment Share on other sites More sharing options...
cikcak Posted March 27, 2015 Share Posted March 27, 2015 Sorry, I never used TCPDFBarcode class. I have simple <barcode> tags in my templates, but those don't use TCPDF library. Mh, If I check the value with var_dump($barcod) I got correct bar code. And then add in footer {$barcod} I see only line like <hr />. So strange.. Link to comment Share on other sites More sharing options...
Touf Posted April 2, 2015 Share Posted April 2, 2015 Hello, I have same problem. I try to include the generated HTML correctly; I think the tcpdf doesn't manage the "relative position". Someone has another idea? Link to comment Share on other sites More sharing options...
ylli Posted May 29, 2015 Share Posted May 29, 2015 I have the same problem. Anyone found the solution to this ? Link to comment Share on other sites More sharing options...
cikcak Posted May 29, 2015 Share Posted May 29, 2015 Hey, Ive changed my mind and using generated barcode in picture, but after all I commented a few lines maybe it helps u. $this->write1DBarcode('www.site.com', 'C39+', '', '', 20, 10, 0.4, $style, 'N'); It works , check write1DBarcode function details. Link to comment Share on other sites More sharing options...
ylli Posted May 29, 2015 Share Posted May 29, 2015 Hello, thank you for the reply I am using a tpl template to generate pdf and using this code: $pdf = new PDF($this->boxes, PDF::TEMPLATE_AIRWAY,Context::getContext()->smarty); $pdf->render(true); This is how i generate barcode: $tcpdfbarcode = new TCPDFBarcode($order->getUniqReference(), EAN13); $bar = $tcpdfbarcode->getBarcodePNG(2, 30, array(0,0,0) ); and i assign the $bar to smarty data so i can print them in tpl template. Can you tell me how can i add this to smarty ? Thank you Link to comment Share on other sites More sharing options...
irrelevant Posted May 29, 2015 Share Posted May 29, 2015 This is how I added barcodes to templates, with no need to change any php code. For yours, $bar has a png image in it. You might be able to do something like $smarty->assign('bar', base64_encode($bar)); then in the template <img src="data:image/png;base64,{$bar}" alt="barcode"> But I haven't tested that at all! Link to comment Share on other sites More sharing options...
ylli Posted May 30, 2015 Share Posted May 30, 2015 The post that you gave the link to solved my problem. Thank you Link to comment Share on other sites More sharing options...
Recommended Posts