elPresta
elPresta

Reputation: 648

Prestashop TCPDF pdf invoice

I can`t solve this prestashop invoice problem. Prestashop use TCPDF to generate PDF invoice.

This is my footer.tpl code:

<table style="width: 100%;">
    <tr>
        <td style="width: 100%">
            <img src="http://myshop.com/img/invoicefooter.jpg"  />
        </td>
    </tr>
</table>

As u can see, I include image on footer. And Prestashop generate header and footer on every page. So its okey for me, but let you show: This is example of invoice with 2 pages: first page footer ( http://prntscr.com/6nn5c9 ) and this is the last page footer - http://prntscr.com/6nn5lo

I cant understand whats wrong. I tried to look at TCPDF.php functions footer, getfooter() and etc..

Briefly, if I have 1 page PDF invoice it shows correct. If I have PDF invoice with 2 pages I got correct view only on last page...

Thanks for any help! Its very important for me..

Upvotes: 0

Views: 2693

Answers (1)

elPresta
elPresta

Reputation: 648

Mh, I found a solution. I really dont know why and don`t have too much time to look for bug, but this method help me to add correct image on every page footer.

Extend PDFGenerator.php in prestashop/classes/pdf and look for function footer:

$this->Image($image_file, 11, 241, 189, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false);

Use function Image to put image on footer. Now I can see correct image on every page.

Upvotes: 2

Related Questions