itoverblik Posted March 7, 2017 Share Posted March 7, 2017 To WHMCS forum members I am trying to understand the header & footer options within the invoicepdf.tpl file. As mentioned in KB http://docs.whmcs.com/PDF_Invoice_Customisation it should be straight forward. But when I have created the invoicepdffooter.tpl file and added standard PHP or HTML code within the PDF file is corrupt. What syntax should I use and where do I see some examples so that I can get an idea on how to handle it? Thanks in advance - Tim 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Product Manager WHMCS John Posted March 9, 2017 WHMCS Product Manager Share Posted March 9, 2017 Hi, Can you clarify exactly how the file is corrupt when you create it? Are you getting an actual corruption error, or is is just not being displayed as expected? Perhaps post a screenshot and your customised template files so we can review? 0 Quote Link to comment Share on other sites More sharing options...
itoverblik Posted March 19, 2017 Author Share Posted March 19, 2017 Hi John Thanks for your reply, I didn't see your reply due to missing notifications. I will get back to you with screenshots. What I meant with corrupt PDF is that it get's created but when I tries to open the PDF file Adobe Reader drops an error saying the file is corrupt. - Tim 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 19, 2017 Share Posted March 19, 2017 perhaps the post below might help where I used the footer/head to show the current page number.... https://forum.whmcs.com/showthread.php?124106-Invoice-page-number&p=507862#post507862 perhaps you're not adding <?PHP to the start of the file ? 0 Quote Link to comment Share on other sites More sharing options...
itoverblik Posted March 21, 2017 Author Share Posted March 21, 2017 Hi Brian Just what I needed, it works fine with the page of as mentioned in the other forum post Now I will try to get it working with the stuff I wanted to use with these files, currently unknown and forgotten, it might get back to me, LOL. Another question Brian. How do add a code to the invoicepdf.tpl so that it make a page break to be able to add our business terms on a new page within the PDF file? - Tim 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 21, 2017 Share Posted March 21, 2017 How do add a code to the invoicepdf.tpl so that it make a page break to be able to add our business terms on a new page within the PDF file? cheat - and attach it as a separate PDF to the invoice email template! but if you really want to add the terms to the same PDF, you could use the following code... $pdf->AddPage(); $pdf->setPage($pdf->getPage()); $ourterms = 'The quick brown fox jumped over the lazy dog.'; $pdf->writeHTML($ourterms, true, false, false, false, ''); the first two lines are the important ones - after that, it's just a case of choosing how/what to output... e.g using HTML, a HTML table... or using the Cell/Multicell options. e.g if you copy/paste the WHMCS terms, and added some HTML coding to the output, the next page after the invoice would start... 0 Quote Link to comment Share on other sites More sharing options...
pilotpanda Posted March 12, 2021 Share Posted March 12, 2021 Hi, I have question for add some footer on Invoice but the footer inform our bank account detail. It is possible to do that? Thank You 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.