Jump to content

Add dynamic image to invoice (TCPDF)


sgonzalez

Recommended Posts

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!

Link to comment
Share on other sites

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, '');

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated