Pragmatism in Code

Michael Percy AKA DeeEmm - Waxing lyrical about life the universe and everything software related...

  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that has been used in the blog.
  • Login
Posted by on in Joomla 1.5 How To's
  • Font size: Larger Smaller
  • Hits: 5404
  • 0 Comments
  • Print

PDF Generation - Add Custom text into footer

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

Rate this blog entry:
Trackback URL for this blog entry.
DeeEmm AKA Michael Percy is an industrial software engineer specialising in language based programming. A long time supporter and contributor to the open source community, he can mostly be found tinkering about creating web sites and plugins for various CMS platforms as well as maintaining several websites of his own.
  • No comments found
Add comment