Jump to content

Headers and Footers in the PDF Invoice


serverstage

Recommended Posts

After searching the forums it was obvious that others might be interested and no solution could be found. So, I'll just answer my own question. But first-off let me say that TCPDF is really hard-core stuff! Would be nicer to have something which converts HTML to PDF...

 

My wish was to move the logo into the header area and make the background black.

 

Resources:

http://www.tcpdf.org/examples.php

http://www.tcpdf.org/doc/classTCPDF.html

http://api.joomla.org/com-tecnick-tcpdf/TCPDF.html#methodCell

includes/tcpdf.php

templates/{yours}/invoicepdf.tpl

 

##### Changes to invoicepdf.tpl:

$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);

$pdf->SetHeaderData('logo.png',50);

$pdf->setHeader();

# Logo

//$pdf->Image(ROOTDIR.'/images/logo.jpg',20,25);

//$pdf->Ln();

 

##### Changes to tcpdf.php:

# Look for: function Header (around line 2531 in WHMCS v.4.4.2)

# insert this line right before the logo is added (4th line in)

$this->Rect(0,0,1370,15,'F','',array(0,0,0));

 

##### Also had to create the file and directory:

includes/images/logo.png

 

 

And now on to the Footer...

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