Main menu

PDF Generation - Add Custom text into footer

by in Joomla 1.5 How To's
  • Font size: Larger Smaller
  • Hits: 13927
  • Subscribe to this entry
  • Print
13927

This is a quick and dirty hack to add some text to the footer of the PDF's generated within Joomla. The library used to generate the PDF's is the open source TCPDF library - http://www.tcpdf.org To add code into the footer of the generated PDF's, you will need to edit the following file:

/libraries/tcpdf/tcpdf.php

Find the following code in the footer() function

//Print page number
if ($this->rtl) {
$this->SetX($this->original_rMargin);
$this->Cell(0, $footer_height, $pagenumtxt, 'T', 0, 'L');
} else {
$this->SetX($this->original_lMargin);
$this->Cell(0, $footer_height, $pagenumtxt, 'T', 0, 'R');
}

 

Underneath it add the following code - replacing the text with your own

                //DeeEmm footer text hack
                $this->SetY($footer_y);
                $this->Cell(0, 10, 'www.DeeEmm.com', 0, 0, 'C');


Hey presto - you now have additional text in your footer

Add comment

Search