Jump to content

Need help to understand the header & footer options within invoicepdf.tpl


itoverblik

Recommended Posts

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

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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! :-P

 

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...

 

XHY4q4Y.png

Link to comment
Share on other sites

  • 3 years later...

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