sgonzalez Posted February 8, 2017 Share Posted February 8, 2017 Hi, I have been trying to add this dynamic image to the invoice PDF template but I didnt succeed.. can you please help me? I need to add a barcode that is automatically generated by an URL API.. Here is what I used on clientexec.. but its not working on WHMCS.. maybe because of the TCPDF language... <img src="https://www.cuentadigital.com/generador3.php?id=333333&codigo=<?php echo $this->$invoiceid; ?>" /> Its an URL that must generate a barcode automatically with the invoiceid. for example.. https://www.cuentadigital.com/generador3.php?id=333333&codigo=59668 That will create a barcode with the invoice number 59668 ( WHERE 333333 is my merchant ID and 59668 is the invoice number) Thanks! 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 8, 2017 Share Posted February 8, 2017 you should be able to do the following in invoicepdf.tpl... $pdf->writeHTML('<img src="https://www.cuentadigital.com/generador3.php?id=333333&codigo='.$invoiceid.'" />', true, false, false, false, ''); if you needed to do something more complicated HTML-wise, e.g put it in a html table, it might be easier to create a separate variable and use that in the writeHTML line... $barcode = '<img src="https://www.cuentadigital.com/generador3.php?id=333333&codigo='.$invoiceid.'" />'; $pdf->writeHTML($barcode, true, false, false, false, ''); 0 Quote Link to comment Share on other sites More sharing options...
sgonzalez Posted February 8, 2017 Author Share Posted February 8, 2017 Hi Brian, I just wanted to say Thanks because you saved my day I was able to insert that image successfully. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.